Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Environment variables not removed.


5 replies to this topic

philipeccles

philipeccles
  • Full Members
  • 1 posts

Posted 16 May 2008 - 10:48

I am using InstallShield Express Version 3.5 ServicePack4 (I know it's ancient).

I add a value to the PATH enviroment variable:

Feature=Alawys Install
On Install=Set
Placement=Append
On Uninstall=Remove
Type=System

I build my release as a single image (setup.exe).

The problem is that when I uninstall our product the string is not removed from the PATH environment variable.

I've been using this project for years and this has always worked previously. The one difference I can think of is that the size of the setup.exe has grown from 125MB to 250MB.

I ran uninstall through the debugger. On an old project whwn it works the output is:

MSI (s) (30:0C) [16:49:58:535]: Executing op: ActionStart(Name=RemoveEnvironmentStrings,Description=Updating environment strings,Template=Name: [1], Value: [2], Action [3])
MSI (s) (30:0C) [16:49:58:535]: Executing op: ProgressTotal(Total=9,Type=1,ByteEquivalent=13200)
MSI (s) (30:0C) [16:49:58:535]: Executing op: UpdateEnvironmentStrings(Name=PDESC,Value=NUTC,Delimiter=[~],Action=536870916,)
MSI (s) (30:0C) [16:49:58:535]: Executing op: UpdateEnvironmentStrings(Name=PATH,Value=;C:\Program Files\Coda\GeoSurvey\scripts;C:\Program Files\Coda\GeoSurvey\bin,Delimiter=;,Action=1610612740,)
MSI (s) (30:0C) [16:49:58:535]: Executing op: UpdateEnvironmentStrings(Name=NUT_SEC_ATTR_OFF,Value=1,Delimiter=[~],Action=536870916,)
MSI (s) (30:0C) [16:49:58:535]: Executing op: UpdateEnvironmentStrings(Name=NEW_CODA_VERSION,Value=4.2.0,Delimiter=[~],Action=536870916,)
MSI (s) (30:0C) [16:49:58:535]: Executing op: UpdateEnvironmentStrings(Name=CODA_INSTALLDIR,Value=C:\Program Files\Coda\GeoSurvey\,Delimiter=[~],Action=536870916,)
MSI (s) (30:0C) [16:49:58:535]: Executing op: UpdateEnvironmentStrings(Name=CODA_USERDIR,Value=C:\\Documents and Settings\coda\geosurvey,Delimiter=[~],Action=536870916,)
MSI (s) (30:0C) [16:49:58:535]: Executing op: UpdateEnvironmentStrings(Name=TZ,Value=GMT,Delimiter=[~],Action=536870916,)
MSI (s) (30:0C) [16:49:58:535]: Executing op: UpdateEnvironmentStrings(Name=CODA_DRIVE,Value=C:\,Delimiter=[~],Action=536870916,)


On a new project when the uninstall fails the output is:

SI (s) (30:C8) [17:13:39:864]: Executing op: ActionStart(Name=RemoveEnvironmentStrings,Description=Updating environment strings,Template=Name: [1], Value: [2], Action [3])
MSI (s) (30:C8) [17:13:39:864]: Executing op: ProgressTotal(Total=8,Type=1,ByteEquivalent=13200)
MSI (s) (30:C8) [17:13:39:864]: Executing op: UpdateEnvironmentStrings(Name=PDESC,Value=NUTC,Delimiter=[~],Action=536870916,)
MSI (s) (30:C8) [17:13:39:864]: Executing op: UpdateEnvironmentStrings(Name=PATH,Value=;C:\Program Files\Coda\GeoSurvey\scripts;C:\Program Files\Coda\GeoSurvey\bin,Delimiter=;,Action=1610612740,)
MSI (s) (30:C8) [17:13:39:864]: Executing op: UpdateEnvironmentStrings(Name=NUT_SEC_ATTR_OFF,Value=1,Delimiter=[~],Action=536870916,)
MSI (s) (30:C8) [17:13:39:864]: Executing op: UpdateEnvironmentStrings(Name=NEW_CODA_VERSION,Value=4.2.0,Delimiter=[~],Action=536870916,)
MSI (s) (30:C8) [17:13:39:864]: Executing op: UpdateEnvironmentStrings(Name=CODA_INSTALLDIR,Value=C:\Program Files\Coda\GeoSurvey\,Delimiter=[~],Action=536870916,)
MSI (s) (30:C8) [17:13:39:864]: Executing op: UpdateEnvironmentStrings(Name=CODA_USERDIR,Value=C:\\Documents and Settings\coda\geosurvey,Delimiter=[~],Action=536870916,)
MSI (s) (30:C8) [17:13:39:864]: Executing op: UpdateEnvironmentStrings(Name=TZ,Value=GMT,Delimiter=[~],Action=536870916,)
MSI (s) (30:C8) [17:13:39:864]: Executing op: UpdateEnvironmentStrings(Name=CODA_DRIVE,Value=C:\,Delimiter=[~],Action=536870916,)


The only differences I can see are the Total=9 and Total=8 on the second lines. Some of the other environemnt variables are removed, others aren't.

Can anyone give me a clue where I should start looking?

Many Thanks,

Phil

hsteinbeck

hsteinbeck
  • Full Members
  • 2 posts

Posted 13 August 2010 - 23:41

I’m experiencing a similar problem. did you ever figure out what was going on?

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 14 August 2010 - 11:45

How are you checking whether or not the variables are removed, via a command prompt or by looking at the registry data directly?

Are they System or User variables? If System-level, they won't be removed from the environment until after a reboot and if User-level, you need to start a new process (e.g. a new command prompt) to check.

Edited by VBScab, 14 August 2010 - 11:45.

- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 18 August 2010 - 15:36

If you are using properties in your environment entires, make sure their value at uninstall is exactly the same as at install time (otherwise Windows Installer doesn't know which part of the PATH to remove)

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 19 August 2010 - 01:43

From memory there is an issue with the trailing \ in the path. As Stefan says it must match exactly what is in the path or the removal doesn't happen. There are several pitfalls with Path updates. A much better approach is to talk to the developers of the software you are developing, if you can, and have them eliminate the use of environment variables. It's an obsolete concept, a good developer would know that, though it is not always possible to update old code.
Regards
-Stein Åsmul

hsteinbeck

hsteinbeck
  • Full Members
  • 2 posts

Posted 19 August 2010 - 22:52

Stefan –Your assessment was correct the values of the environment variables I was trying to un-install were different than what was actually on the machine. Once I set the properties to match what was installed the variables were removed.

Glytzhkof – I am indeed working with a mature product, but I totally agree configuring software through environment variables = bad idea, but it’s what I have to live with.

Thanks guys for your input.