- NSIS Discussion
- Uninstall Error
Archive: Uninstall Error
Jermbox
11th June 2003 20:27 UTC
Uninstall Error
I am getting this strange error when I try to start the uninstall exe. I get a popup that says "Error launching Installer". I pulled everything out of the uninstall section except the basics, and still get the same results. See code below:
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\RT Workstation" "DisplayName" "RT Workstation (remove only)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\RT Workstation" "UninstallString" "$INSTDIR\Uninst.exe"
WriteUninstaller "$INSTDIR\Uninst.exe"
SectionEnd
Section "Shortcuts"
;Add Shortcuts
SectionEnd
UninstallText "This will uninstall RT Workstation from your system"
UninstallIcon "E:\Files\Projects\Install\isicon.ico"
Section Uninstall
;Delete Files
; Directories To Remove During Uninstall
RMDir /r "$INSTDIR\BIN"
; Delete Uninstaller And Unistall Registry Entries
Delete "$INSTDIR\Uninst.exe"
SectionEnd
I looked around in this forum but can't seem to find any info on this error. Anyone have any ideas?
Thanks in advance,
J
Joel
11th June 2003 20:54 UTC
From where you are uninstalling, via:
Control panel (add/remove), start menu, or other shortcut?
ramon18
11th June 2003 21:29 UTC
Can you upload you script (simplified)?
Jermbox
11th June 2003 21:41 UTC
Script
Here is the script... thinned out the install files list but the rest is normal.
To Lobo, I have tried it both from CP,start menu and the actual unistall file itself... no luck.
Thanks in advance,
J
ramon18
11th June 2003 21:44 UTC
Your attach failed!?! maybe you should zip it out?
Jermbox
11th June 2003 22:21 UTC
Try again
Let try this again ...
ramon18
11th June 2003 22:29 UTC
Working fine
Run for me like a charm!
Perhaps problems with your OS or something, have you tried executing "Uninst.exe" directly from explorer or from a MS-DOS prompt?
good luck
Ramon
Jermbox
11th June 2003 22:43 UTC
Hmmm
Thats strange ...
tried the exe on both my XP Pro box and on a 2000 box with the same results. Mind if I ask what version of NSIS you are using? I built the installer with nsis20b3. Not sure if that matters much.
Anyways, thanks for looking.
J
ramon18
11th June 2003 22:47 UTC
Can you upload the Uninst.exe? (zipped)
I can try it on my box, this will tell if the problem is NSIS version,
btw: my version is current CVS developing version
cyas
Ramon
micolithe
11th June 2003 22:48 UTC
It looks like a registry error.
Jermbox
12th June 2003 14:18 UTC
uninst file
Ramon - Here is the uninst.exe file generated during the install process.
J
kichik
12th June 2003 14:19 UTC
What is the content of the $TEMP variable on your computer? Does it exist? Are there any files named *~NSISu_.exe in your temporary directory? How many of them? If there are any files like that, what happens if you delete them? Does the uninstaller work again? Does it create a new one?
kichik
12th June 2003 14:20 UTC
What OS are you working on?
Jermbox
12th June 2003 14:48 UTC
Answers
?: What is the content of the $TEMP variable on your computer?
Temp=%USERPROFILE%\Local Settings\Temp
?: Does it exist?
Yes
?: Are there any files named *~NSISu_.exe in your temporary directory?
There is one file in dir, A~NSISu_.exe
?: If there are any files like that, what happens if you delete them? Does the uninstaller work again? Does it create a new one?
When I delete the A~NSISu_ file and run the uninstall exe again it gives same error and generates another A~NSISu_ file in the Temp dir.
This machine is running WinXP Pro SP-1 but also tried it on Win2K SP-3 with same results. The only thing simlar is they both have nsis20b3 installed.
kichik
12th June 2003 14:53 UTC
Does the value of $TEMP literally contains %USERPROFILE% or have you taken this from another place such as the registry.
Jermbox
12th June 2003 15:00 UTC
The value of the variable is actually %userprofile%\Local Settings\Temp , but when checked on the command line with a SET command it resolves itself to the actual dir path. When you had asked about that in your earlier post I thought maybe there might be some issue with the uninstaller being able to resolve the %userprofile% variable as the TEMP value. So, I created a dir C:\temp and adjusted the temp variable. Re-ran install and attempted uninstall with same results
kichik
12th June 2003 16:17 UTC
Can you please run the attached installer (installs nothing, just uses NSIS scripting), copy the results (right click on the list) and attach it here as a text file?
I just want to be sure of some facts before we continue.
Jermbox
12th June 2003 16:22 UTC
Looks like the attachment didn't stick, could you post it again please.
Thanks.
kichik
12th June 2003 16:24 UTC
Oops... Here it is.
Jermbox
12th June 2003 16:35 UTC
Results
TEMP
C:\Temp
TEMP from HKCU\Environment
C:\Temp
TMP from HKCU\Environment
C:\Temp
TEMP from HKLM\...\Environment
%SystemRoot%\TEMP
TMP from HKLM\...\Environment
%SystemRoot%\TEMP
ReadEnvStr $0 TEMP
C:\Temp
ReadEnvStr $0 TMP
C:\Temp
ExpandEnvStrings $0 %TEMP%
C:\Temp
ExpandEnvStrings $0 %TMP%
C:\Temp
RegOpenKeyEx returned 0
RegQueryValueEx returned 0
TEMP is 1
RegQueryValueEx returned 0
TMP is 1
RegCloseKey returned 0
Completed
kichik
12th June 2003 16:47 UTC
Well, I was actually more interseted in the old settings.
Is there any message box appearing before the "Can't launch installer" message box in the attached uninstaller?
Jermbox
12th June 2003 17:14 UTC
Hmmm
Ok .... this is going to sound strange but here is something interesting:
I downloaded the uninst file you posted, un-zipped to the desktop and it ran without error. I then took my uninst file from the root of C:\ and brought it to the desktop and it ran fine. Copied it back to the root, ran it and got the original error. I then copied your uninst file to C:\ and also got the error. Not really sure what this means.
Ideas?
J
:attached error message
kichik
12th June 2003 17:23 UTC
Ooh! Now I see what's the thing is. It's not a bug, it's a feature :)
NSIS doesn't consider the root directory of drives to be a valid installation directory unless forced to (using AllowRootDirInstall).
The error might be vague but just imagine what would have happened if you'd a RMDir /r Windows in your uninstall script...
Jermbox
12th June 2003 17:45 UTC
Wow... what a long road we traveled to get to this point. :)
Kichik / Ramon18, Thanks alot for your help getting this figured out.
I appreciate your time and effort.
J.
DrPeggs
29th November 2007 08:44 UTC
I realise this is an ancient thread but i had the same issue today when a user installed to c:\ and then couldnt uninstall
I understand the reason for having the AllowRootDirInstall flag but my question is - why on earth let people install to root if they cant uninstall? i.e. shouldnt AllowRootDirInstall (or rather the lack of) apply to the install process as well as the uninstall?
or am i being dim?
kichik
29th November 2007 17:24 UTC
The following simple script works perfectly fine for me and it shows AllowRootDirInstall affects both the installer and the uninstaller. Are you sure you're using the greatest and latest and that your script uses AllowRootDirInstall?
Name test
OutFile test.exe
AllowRootDirInstall true
Section
WriteUninstaller C:\uninst.exe
Exec "C:\uninst.exe"
SectionEnd
Section uninstall
SectionEnd
DrPeggs
4th December 2007 09:21 UTC
hi
i am running version 2.30 which i realise isn't the latest and the string AllowRootDirInstall does not appear anywhere in my script, which is why i was surprised it allowed installation to C:\ if it didnt allow uninstallation.
Anyway, i now see how it is meant to be used so can get round the problem if necessary