cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mikegillow
Level 5

Uninstal Prob with Env Vars containing INSTALLDIR

Basic MSI. If I set an environment variable based on [INSTALLDIR], on uninstall, the values are left behind. If I use the same test project but use static contents instead of INSTALLDIR, the values remove properly.

Examining the log from the uninstall, looking at "Value=" portion of the "UpdateEnvironmentStrings" operation, I see that [INSTALLDIR] has been resolved to its default value rather than the actual install location. My assumption is that since the resulting string doesn't match the actual contents of the env var, nothing gets done.

Is there something special I'm supposed to do to 'restore' the value of INSTALLDIR for the uninstall process when it comes to env vars?
Labels (1)
0 Kudos
(2) Replies
mikegillow
Level 5

Looks like the answer is 'yes'. I found references to this article by Robert Dickau.

But I also found this thread started by Chris Painter that suggests that the condition for the built-in setARPINSTALLLOCATION CA isn't appropriate for minor upgrades. What should the condition really be?
0 Kudos
mikegillow
Level 5

OK, now I'm really confused. I made changes based on the article (stored INSTALLDIR in a reg entry, added a System Search to pull it back out, and added a Set Property CA to 'restore' INSTALLDIR) and had everything working under 'normal' conditions. I then checked to see what would happen if I deleted the registry entry where I was storing INSTALLDIR before I uninstalled - and it still worked?!?! But based on what I thought I knew, it should not have, and looking at the logs I saw that my CA was being (correctly) skipped.

I rolled back all of my changes and ultimately found that by adding ONLY a registry entry to store INSTALLDIR (doing this in the Registry view of the IDE resulted in automatic creation of a component named ISRegistryComponent), my problem simply 'went away'.

One possibly significant note - prior to adding this entry, the installer didn't have any other registry items being added (at least not any that showed up in the Registry view of the IDE).

What I found in the uninstall log if ISRegistryComponent was included (note the next-to-last line):
Action start 12:51:47: CostFinalize.
MSI (c) (B4:B0) [12:51:47:500]: PROPERTY CHANGE: Adding OutOfDiskSpace property. Its value is '0'.
MSI (c) (B4:B0) [12:51:47:500]: PROPERTY CHANGE: Adding OutOfNoRbDiskSpace property. Its value is '0'.
MSI (c) (B4:B0) [12:51:47:500]: PROPERTY CHANGE: Adding PrimaryVolumeSpaceAvailable property. Its value is '0'.
MSI (c) (B4:B0) [12:51:47:500]: PROPERTY CHANGE: Adding PrimaryVolumeSpaceRequired property. Its value is '0'.
MSI (c) (B4:B0) [12:51:47:500]: PROPERTY CHANGE: Adding PrimaryVolumeSpaceRemaining property. Its value is '0'.
MSI (c) (B4:B0) [12:51:47:500]: Note: 1: 2205 2: 3: MsiAssembly
MSI (c) (B4:B0) [12:51:47:500]: Note: 1: 2228 2: 3: MsiAssembly 4: SELECT `MsiAssembly`.`Attributes`, `MsiAssembly`.`File_Application`, `MsiAssembly`.`File_Manifest`, `Component`.`KeyPath` FROM `MsiAssembly`, `Component` WHERE `MsiAssembly`.`Component_` = `Component`.`Component` AND `MsiAssembly`.`Component_` = ?
MSI (c) (B4:B0) [12:51:47:516]: PROPERTY CHANGE: Adding WIN32 property. Its value is 'F:\test me\ASA\win32'.
MSI (c) (B4:B0) [12:51:47:516]: PROPERTY CHANGE: Adding SYBASE_CENTRAL_4.3 property. Its value is 'F:\test me\ASA\Shared\Sybase Central 4.3'.
MSI (c) (B4:B0) [12:51:47:516]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'F:\test me'.
MSI (c) (B4:B0) [12:51:47:516]: PROPERTY CHANGE: Adding ASA_WIN32.718A0947_91C9_402F_97BC_9DAFA256BC57 property. Its value is 'F:\test me\ASA\win32'.

Versus when it wasn't (note that the line adding the INSTALLDIR property isn't there anymore):
Action start 12:51:47: CostFinalize.
MSI (c) (CC:B0) [12:31:09:228]: PROPERTY CHANGE: Adding OutOfDiskSpace property. Its value is '0'.
MSI (c) (CC:B0) [12:31:09:228]: PROPERTY CHANGE: Adding OutOfNoRbDiskSpace property. Its value is '0'.
MSI (c) (CC:B0) [12:31:09:228]: PROPERTY CHANGE: Adding PrimaryVolumeSpaceAvailable property. Its value is '0'.
MSI (c) (CC:B0) [12:31:09:228]: PROPERTY CHANGE: Adding PrimaryVolumeSpaceRequired property. Its value is '0'.
MSI (c) (CC:B0) [12:31:09:228]: PROPERTY CHANGE: Adding PrimaryVolumeSpaceRemaining property. Its value is '0'.
MSI (c) (CC:B0) [12:31:09:228]: Note: 1: 2205 2: 3: MsiAssembly
MSI (c) (CC:B0) [12:31:09:228]: Note: 1: 2228 2: 3: MsiAssembly 4: SELECT `MsiAssembly`.`Attributes`, `MsiAssembly`.`File_Application`, `MsiAssembly`.`File_Manifest`, `Component`.`KeyPath` FROM `MsiAssembly`, `Component` WHERE `MsiAssembly`.`Component_` = `Component`.`Component` AND `MsiAssembly`.`Component_` = ?
MSI (c) (CC:B0) [12:31:09:228]: PROPERTY CHANGE: Adding WIN32 property. Its value is 'F:\test me\ASA\win32'.
MSI (c) (CC:B0) [12:31:09:228]: PROPERTY CHANGE: Adding SYBASE_CENTRAL_4.3 property. Its value is 'F:\test me\ASA\Shared\Sybase Central 4.3'.
MSI (c) (CC:B0) [12:31:09:228]: PROPERTY CHANGE: Adding ASA_WIN32.718A0947_91C9_402F_97BC_9DAFA256BC57 property. Its value is 'F:\test me\ASA\win32'.
0 Kudos