kinar
15th October 2007, 17:11
I have an installer that checks to see if the software is already installed and forces an uninstall before allowing a reinstall. To force the uninstall, I use ExecWait.
ExecWait '"$PATH_DIR" _?=$INSTDIR'
I also have a check in my uninstall that verifies the app isn't running when you uninstall by renaming the install directory, renaming it back and checking for errors.
If the rename fails, then the uninstall aborts because files are already in use.
The problem is that when the installer launches the uninstaller, forcing it to not copy to a temp directory so that it actually waits, the uninstaller is in use and the rename fails and doesn't allow the uninstall.
As a result, a user must uninstall "manually" before installing. So ultimately I have the desired effect but at the expense of end user confusion.
Can someone think of a better way around this?
I could check each individual file to see if it is in use (instead of renaming) but that causes problems of modifying my installer everytime a new file is created that needs to be uninstalled. This is the only workable, yet undesirable, solution I have thus far.
In the FAQ for ExecWait, I noticed this quote:
To get around this problem, the executed installer must be told to wait for the sub-installer or simply do the work itself.
This seems like an acceptable solution. My above implementation forces the installer to do the work itself (instead of copying itself to a temp dir and then running). I implemented it this way because I was told it is the only workaround that allows the installer to wait for an uninstall to complete before finishing.
How can I tell the installer to wait for the sub-installer instead?
ExecWait '"$PATH_DIR" _?=$INSTDIR'
I also have a check in my uninstall that verifies the app isn't running when you uninstall by renaming the install directory, renaming it back and checking for errors.
If the rename fails, then the uninstall aborts because files are already in use.
The problem is that when the installer launches the uninstaller, forcing it to not copy to a temp directory so that it actually waits, the uninstaller is in use and the rename fails and doesn't allow the uninstall.
As a result, a user must uninstall "manually" before installing. So ultimately I have the desired effect but at the expense of end user confusion.
Can someone think of a better way around this?
I could check each individual file to see if it is in use (instead of renaming) but that causes problems of modifying my installer everytime a new file is created that needs to be uninstalled. This is the only workable, yet undesirable, solution I have thus far.
In the FAQ for ExecWait, I noticed this quote:
To get around this problem, the executed installer must be told to wait for the sub-installer or simply do the work itself.
This seems like an acceptable solution. My above implementation forces the installer to do the work itself (instead of copying itself to a temp dir and then running). I implemented it this way because I was told it is the only workaround that allows the installer to wait for an uninstall to complete before finishing.
How can I tell the installer to wait for the sub-installer instead?