Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 3

public properties reset to default values

Hi everyone,

I have an installshield 2008 InstallScript MSI Project, in which I have added public properties in the Property Manager (all uppercase). I have even added them in the SecureCustomProperties property value, separated with semi-colons. Here is the issue:

I have an installscript function called OnFirstUIBefore which is executed immediately which basically provides the user interface and gathers information. It also sets the public properties to the values that the user specifies. This appears to work fine as, after I've set them, I have immediately retrieved them and seen that the values are correct (using the debug feature in the installshield project).
I also have another installscript function called Server_Installed which is called after the Server feature is installed (i.e. the feature's OnInstalled property is set to the Server_Installed function). The problem is that when I retrieve the public properties' values at this point, the properties are all back to their default values initially setup in the Property Manager. I know that this Server_Installed function appears to be one of the last functions to execute in the install (not sure exactly where it fits in the Execute sequence however, nor how to tell where).

Does anyone have any ideas why the public properties would have gone back to their defaults?

Any help would be greatly appreciated!
Labels (1)
0 Kudos
6 Replies
Level 3

Have you tried generating a log file:

setup.exe /v"/l*v c:\log.log"

If you look through this will be able to see where the properties are being reset, and then you might find out why.
0 Kudos
Level 3

Thanks for your reply, I really appreciate it! But in reply:

I've done what you said and created a log. I also put in a SprintfBox command in the Server_Installed function I created (which is called from the OnInstalled property of the Server feature) to show the value assigned to the COMPLUSTYPE property and determine exactly when in the log it is executed; when the messagebox pops up, it shows that the property is back to the default value. The interesting part is that it does indeed print out the properties as I've set them a little earlier in the log, like so:

Action start 13:22:59: ISSQLServerFinalize.
Action ended 13:23:00: ISSQLServerFinalize. Return value 1.
Action ended 13:23:00: INSTALL. Return value 1.
Property(S): DiskPrompt = [1].
Property(S): COMPLUSTYPE = Server (*** correct value ***)
Property(S): ProductLanguage = 1033
MSI (s) (C8:C0) [13:23:00:185]: Note: 1: 1707
MSI (s) (C8:C0) [13:23:00:185]: Product: (*** Product Name ***) -- Installation operation completed successfully.

MSI (s) (C8:C0) [13:23:00:205]: Cleaning up uninstalled install packages, if any exist
MSI (s) (C8:C0) [13:23:00:205]: Post-install cleanup: removing installer file 'C:\WINNT\Installer\9357f.msi'
MSI (s) (C8:C0) [13:23:00:205]: MainEngineThread is returning 0
MSI (s) (C8:B0) [13:23:00:215]: Destroying RemoteAPI object.
MSI (s) (C8:64) [13:23:00:215]: Custom Action Manager thread ending.
=== Logging stopped: 4/21/2008 13:23:00 ===
MSI (c) (00:A4) [13:23:00:255]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (c) (00:A4) [13:23:00:255]: MainEngineThread is returning 0
=== Verbose logging stopped: 4/21/2008 13:23:00 ===

=== Verbose logging started: 4/21/2008 13:23:02 Build type: SHIP UNICODE 3.01.4000.2435 Calling process: D:\awpmsi\awpmsi\Single EXE\Release\DiskImages\DISK1\setup.exe ===
MSI (c) (00:C8) [13:23:02:398]: Cloaking enabled.
MSI (c) (00:C8) [13:23:02:398]: Attempting to enable all disabled priveleges before calling Install on Server
MSI (c) (00:C8) [13:23:02:398]: End dialog not enabled
MSI (c) (00:C8) [13:23:02:398]: Original package ==> C:\WINNT\Installer\2df0e7.msi
MSI (c) (00:C8) [13:23:02:398]: Package we're running from ==> C:\WINNT\Installer\2df0e7.msi

It then gets to the point where it does the CostInitialize and CostFinalize actions:

MSI (c) (00:C8) [13:23:02:458]: Doing action: CostInitialize
Action 13:23:02: CostInitialize. Computing space requirements
Action start 13:23:02: CostInitialize.
MSI (c) (00:C8) [13:23:02:488]: Machine policy value 'MaxPatchCacheSize' is 10
MSI (c) (00:C8) [13:23:02:488]: PROPERTY CHANGE: Adding ROOTDRIVE property. Its value is 'C:\'.
MSI (c) (00:C8) [13:23:02:488]: PROPERTY CHANGE: Adding CostingComplete property. Its value is '0'.
Action ended 13:23:02: CostInitialize. Return value 1.
MSI (c) (00:C8) [13:23:02:498]: Doing action: FileCost
Action 13:23:02: FileCost. Computing space requirements
Action start 13:23:02: FileCost.
MSI (c) (00:C8) [13:23:02:498]: Note: 1: 2205 2: 3: MsiAssembly
MSI (c) (00:C8) [13:23:02:498]: Note: 1: 2262 2: Extension 3: -2147287038
Action ended 13:23:02: FileCost. Return value 1.
MSI (c) (00:C8) [13:23:02:498]: Doing action: CostFinalize
Action 13:23:02: CostFinalize. Computing space requirements
Action start 13:23:02: CostFinalize.
MSI (c) (00:C8) [13:23:02:508]: PROPERTY CHANGE: Adding OutOfDiskSpace property. Its value is '0'.
MSI (c) (00:C8) [13:23:02:508]: PROPERTY CHANGE: Adding OutOfNoRbDiskSpace property. Its value is '0'.
MSI (c) (00:C8) [13:23:02:508]: PROPERTY CHANGE: Adding PrimaryVolumeSpaceAvailable property. Its value is '0'.
MSI (c) (00:C8) [13:23:02:508]: PROPERTY CHANGE: Adding PrimaryVolumeSpaceRequired property. Its value is '0'.
MSI (c) (00:C8) [13:23:02:508]: PROPERTY CHANGE: Adding PrimaryVolumeSpaceRemaining property. Its value is '0'.

So I see that it appears to add some properties, but I don't see any changes of the properties I'm concerned with (i.e. COMPLUSTYPE) in the log. So after the Property change entries as shown above, it does the following:

MSI (c) (00:C8) [13:23:02:538]: Target path resolution complete. Dumping Directory table...
MSI (c) (00:C8) [13:23:02:538]: Note: target paths subject to change (via custom actions or browsing)
MSI (c) (00:C8) [13:23:02:538]: Dir (target): Key: TARGETDIR , Object: C:\

and starts listing a bunch of the the Dir (target) entries as above. Finally, my logging (and installation) ends with the following:

MSI (c) (00:C8) [13:23:02:538]: PROPERTY CHANGE: Adding INSTALLLEVEL property. Its value is '1'.
Action ended 13:23:02: CostFinalize. Return value 1.
MSI (c) (00:C8) [13:23:02:548]: Note: 1: 2205 2: 3: ISAlias
MSI (c) (00:C8) [13:23:02:548]: Note: 1: 2228 2: 3: ISAlias 4: SELECT * FROM ISAlias
=== Verbose logging stopped: 4/21/2008 13:25:45 ===

So basically I'm a little confused as to why the log says that the installation completed successfully (during which the property values were correct) but then goes into more logging (i.e. the CostInitialize and CostFinalize actions). Also, I'm wondering why the Server_Installed function is called that late in the install. Finally, I'm wondering if the properties only last as long as the MainEngineThread and Custom Action Manager threads last...don't know.

Does anyone have any ideas?
0 Kudos
Level 3

I had the exact same problem with an InstallScript MSI project and properties being used later in the installation. I opened a support ticket with Macrovision, and over the course of a very frustrating month they were able to replicate the problem, but never really figure out a solution.

I'm paraphrasing here, and I'm sure someone can explain it better, but the issue is that the properties are stored in the InstallScript engine and have to be passed to the MSI engine later in the installation. When passed, they are reset to the initial values.

Ultimately, the best solution the support team could give me was to completely scratch my InstallScript MSI project and rebuild it as a pure MSI project.
0 Kudos
Level 13

Make sure that your PUBLIC PROPERTY names appear in SecureCustomProperties so that the UI sequence value is passed to the execute sequence.

If the value is used by a deferred custom action then you need to use a set property custom action. You name the Property the same exact name as your custom action and set the value of this property to the value you expect in the deferred custom action. This is because only a limited set of properties are available in deferred mode.

In your deferred custom action instead of calling the following

MsiGetProperty(p_hMSI, "MYCOOLPROPERTY", sCoolVal, nBufferSize);

You now call
MsiGetProperty(p_hMSI, "CustomActionData", sCAData, nBufferSize);

If you have more than one property you need for a deferred custom action you will need to chain the property values together in the set property custom action with some type of separator and then call StrGetTokens to parse the values or some other similar type of string parsing.

I hope this helps.
0 Kudos
Level 3

Thank you both for your replies; much appreciated!

My task is to upgrade my installshield X script to Installshield 2008. In Installshield X there was a custom action that called the functions in a feature's OnInstalled and OnUninstalled property; upon reading the Upgrading to Installshield 12 link provided on this website, I saw that this custom action was no longer available starting in Installshield 12, so in order to make the script function execute at the same time as it did in Installshield X, it said to create custom actions to call the functions and insert it into the sequence at a particular place. It said to make the custom actions deferred, so DLee65 was correct in his post; I had to create a property custom action for each of my custom actions to send the proper property values and I delimited them (in my case with a semi-colon). It works correctly now; thanks so much for responding!

Now if I could just get my COM Server integrated into the project; it's been really slow to install for some reason (much slower than Installshield X), but I'll create a new thread for that.
0 Kudos
Level 16

There is a sticky thread discussing issues migrating pre IS12 projects to IS12 and beyond. It's got lots of good points in it.
0 Kudos