SoundScape_2910
22nd January 2005 01:18 UTC
Problem with uninstalling before installing
Hi,
I have an installer which checks whether a product is already installed or not prior to installing. I have included the following code to achieve that:
ReadRegStr $Path HKCU "SOFTWARE\Product\ "InstallPath"
HideWindow
ClearErrors
ExecWait $Path\uninst.exe
BringToFront
Problem is the following: The user has the option to uninstall product or proceed without uninstallation. As soon as he hits the "Uninstall" button, the installer window hides and shows up immediately along with the message box of the uninstaller. In other words, the installer does not wait until uninstaller finishes but becomes visible when it is not supposed to be. Any ideas to overcome this problem?
Thanks in advance! :D
Anders
22nd January 2005 03:20 UTC
the uninstaller copies itself to the temp dir, execs the exe in temp and exits (so it can delete itself). u can manually copy the uninst.exe to temp then exec it with a special command line argument ( "uninst.exe _?=$instdir" if i remember correctly)
superwan
23rd January 2005 15:43 UTC
just have a look at the nsis script ;)
superwan
25th January 2005 13:46 UTC
this command
'uninst.exe _?=$instdir'
does not work athome :(
see ya
superwan
25th January 2005 14:09 UTC
HideWindow
ClearErrors
ExecWait '$INSTDIR\setup_KTV_tmp.exe _?=$INSTDIR'
IfErrors error
Quit
BringToFront
seems to work...
kichik
27th January 2005 14:24 UTC
It will only work if the uninstaller is a NSIS uninstaller. According to the behavior specified, it doesn't like it is. The following page contains information about how to make other installers wait:
http://unattended.sourceforge.net/installers.php
SoundScape_2910
6th February 2005 22:59 UTC
Thanks to everyone who took the time to help me out. Using the "uninst.exe _?=$instdir" command, the problem was solved. Installer window does hide until uninstaller finishes. But another problem surfaced. I have more than one partition in my system and I have set drive C in such a way that a simple user is not allowed to write on it. When I tested my installer using a restricted account, the above command didn't work, i.e. installer window didn't hide. My guess is that since it is not allowed to erite on C, the uninstaller could not be extracted to the TEMP directory. My question is this: is there a way to determine at runtime what the write permissions are for a specific drive or partition? What if a system has only one drive, one partition and a part of it is restricted to a simple user? For example, folders "Program Files" and "Windows" are restricted and all other parts of drive are not. Also, is there a way to determine how many drives/partitions a system has?
Many thanks in advance. I am waiting for your input on these matters.
kichik
10th February 2005 19:35 UTC
The temporary directory is verified. If it's not writable, the installer won't start. There must be another problem.