MSI script

C

catalinus

Hello everyone,

I am working on an install script, that is supposed to change some
values in the MSI tables. The script basically sets up installer's
version from the Assembly's version number.

The update sentence is:

----------------
Dim view: Set view = database.OpenView("Update Property set
Property.Value = File.Version from Property, File, where File.File
like '%AssemblyName.dll%' and Property.Property = 'ProductVersion'")
----------------

Running the script I am receiving the error
"Msi API Error 80004005: OpenView, Sql 1: 2227" 2: Setup.msi 3: Value
4: Update Property set Property.Value = File.Version from Property,
File, where File.File like '%AssemblyName.dll%' and Property.Property
= 'ProductVersion'"

The error is telling me that error 2227 occurred on Setup.msi on field/
attribute Value.

According to http://msdn.microsoft.com/en-us/library/aa372835.aspx,
Error 2227 means
-----------------
Database: [2]. Invalid identifier '[3]' in SQL query: [4].
-----------------
where [2] is Setup.msi, [3] is Value and [4] is the sql sentence.

I have changed the sql sentence to
------------------
Dim view: Set view = database.OpenView("Update Property set
Property.Value = '0.2.0' where Property.Property = 'ProductVersion'")
------------------

And everything was ok. So the problem does not stand in the incorrect
allocation of the objects (i destroy them once i dont use them).

So probably the problem is in the SQL sentence. I dont know what is
the engine used by a MSI installer database, probably it does not
support my first sentence.

Has anyone experienced somethig similar? How did you manage to solve
this kind of problem?

I was thinking to open 2 diferent connections: one that would retrieve
the File.Version value, and another one that would do the update, but
I didn't succeed. Has anyone tried something similar?

Thank you,
C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top