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.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
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
Answered 09/14/2011 by: Teitan
Senior Purple Belt

Please log in to comment
0
Hi Teitan,
Thanks for the response. I have tried WiRunSQL.vbs and it also fails with the same error :(
Answered 09/15/2011 by: deployX
Orange Senior Belt

Please log in to comment
0
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.
Answered 09/15/2011 by: VBScab
Red Belt

Please log in to comment
0
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.
Answered 09/15/2011 by: Teitan
Senior Purple Belt

Please log in to comment
0
Teitan, the sql query you posted failed with the same error. I'll give a try to VBScab's suggestion and post my observations. I wonder why Installshield itself doesn't give this option to let user decide the datatype of a column.
Answered 09/15/2011 by: deployX
Orange Senior Belt

Please log in to comment
0
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.
Answered 09/15/2011 by: VBScab
Red Belt

Please log in to comment
0
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???
Answered 09/22/2011 by: deployX
Orange Senior Belt

Please log in to comment
Answer this question or Comment on this question for clarity