Archive: Problem with uninstalling before installing


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


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)


just have a look at the nsis script ;)


this command

'uninst.exe _?=$instdir'

does not work athome :(
see ya


HideWindow
ClearErrors
ExecWait '$INSTDIR\setup_KTV_tmp.exe _?=$INSTDIR'
IfErrors error
Quit
BringToFront

seems to work...


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


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.


The temporary directory is verified. If it's not writable, the installer won't start. There must be another problem.