Is it possible to change Datatype of standard MSI Table columns.
I am using Installshield to create my MSI. I want to change datatype of DestName column in DuplicateFile table to nchar. By default Installsheild creates this column as L(255).
I wrote a small VBscript to do this but it fails with Error: openview,sql Code: 80004005 Source: Msi API Error. It says problem is in statement
Set View = DB.OpenView(query)
Following is my vbscript:
Set fso = CreateObject("Scripting.FileSystemObject")
Dim FS, TS, WI, DB, View, Rec
Set WI = CreateObject("WindowsInstaller.Installer")
Set DB = WI.OpenDatabase("MyMSI.msi",1)
query="ALTER TABLE DuplicateFile MODIFY DuplicateFile.DestName nchar(255)"
Set View = DB.OpenView(query)
View.Execute
View.Close
DB.Commit
I did some googling but it didn't help.
Any help would be appreciated.
I wrote a small VBscript to do this but it fails with Error: openview,sql Code: 80004005 Source: Msi API Error. It says problem is in statement
Set View = DB.OpenView(query)
Following is my vbscript:
Set fso = CreateObject("Scripting.FileSystemObject")
Dim FS, TS, WI, DB, View, Rec
Set WI = CreateObject("WindowsInstaller.Installer")
Set DB = WI.OpenDatabase("MyMSI.msi",1)
query="ALTER TABLE DuplicateFile MODIFY DuplicateFile.DestName nchar(255)"
Set View = DB.OpenView(query)
View.Execute
View.Close
DB.Commit
I did some googling but it didn't help.
Any help would be appreciated.
0 Comments
[ + ] Show comments
Answers (7)
Please log in to answer
Posted by:
Teitan
13 years ago
I think it would be easier if you get the Windows Installer SDK and run a SQL query against your msi with WiRunSQL.vbs
I've also done this a couple of times mostly to set the 64-bit flag to every component in a msi as InstallShield always creates 32-bit components.
And always backup your MSI before doing such things!
http://msdn.microsoft.com/en-us/library/aa368562(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/aa372021(v=vs.85).aspx
I've also done this a couple of times mostly to set the 64-bit flag to every component in a msi as InstallShield always creates 32-bit components.
And always backup your MSI before doing such things!
http://msdn.microsoft.com/en-us/library/aa368562(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/aa372021(v=vs.85).aspx
Posted by:
deployX
13 years ago
Posted by:
anonymous_9363
13 years ago
80004005 (which boils down to DOS error 5) is 'Access denied'. Fairly obviously, you can't alter the structure of a database which is open.
IIRC, to alter the structure, you need to export the table to an .IDT file (Orca and InstEdit can do this), make the change in the IDT and then import it back.
Search AppDeploy for IDT. I believe AngelD posted the exact procedure a while back.
IIRC, to alter the structure, you need to export the table to an .IDT file (Orca and InstEdit can do this), make the change in the IDT and then import it back.
Search AppDeploy for IDT. I believe AngelD posted the exact procedure a while back.
Posted by:
Teitan
13 years ago
I think your sql query is wrong. Unfortunately I'am not that familar with sql but you could give this query a try:
"UPDATE 'DuplicateFile' SET 'DuplicateFile'.'DestName'='nchar(255)' WHERE 'DuplicateFile'.'DestName'='L(255)'"
If everything works well this query should change the values in the column DestName to "nChar(255)" in each line where the current value is "L(255)"
It shouldn't be necessary to alter the table before you run the query.
"UPDATE 'DuplicateFile' SET 'DuplicateFile'.'DestName'='nchar(255)' WHERE 'DuplicateFile'.'DestName'='L(255)'"
If everything works well this query should change the values in the column DestName to "nChar(255)" in each line where the current value is "L(255)"
It shouldn't be necessary to alter the table before you run the query.
Posted by:
deployX
13 years ago
Posted by:
anonymous_9363
13 years ago
let user decide the datatype of a column.Fine, if you want to break the Windows installer database schema. Try changing one of numeric data types to a text data type and then execute it. Oops! :-)
This type of manipulation is fine-ish, provided you don't fundamentally alter the structure. Mostly, people use it to increase, say, the number of characters allowed in a field.
Posted by:
deployX
13 years ago
Guys, my basic reason for doing all this trickery was that I wanted to use some accented characters (Â) in my file table. These characters appear fine when installed on an English OS but as soon as I install it on a Chinese machine these characters no longer appear properly. They appear as chinese characters :(
I thought if I could code page of my MSI to Unicode 65001 then may be I can get around the issue. I made the change and it seems to work fine but I'm not sure if there are any pitfalls to this. I think windows installer does not officially support 65001 code page.
Should I be using it??? Is there any other solution apart from custom actions???
I thought if I could code page of my MSI to Unicode 65001 then may be I can get around the issue. I made the change and it seems to work fine but I'm not sure if there are any pitfalls to this. I think windows installer does not officially support 65001 code page.
Should I be using it??? Is there any other solution apart from custom actions???
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.