The issue I am having is that whether or not it sees the file, the warning still comes up and it seems that no matter if they click on cancel, it will continue installation when I would like for it to fully abort. Then if they click on "OK" it will uninstall, but then continue with installation right after rather than completing the uninstall and relaunching the installer or aborting the installation totally as the current message I have says to re-launch after uninstallation.Function ClientCheck
IfFileExists "$INSTDIR\File Upload Service\File.exe" warn
warn:
MessageBox MB_OKCANCEL|MB_ICONSTOP "You are trying to install over an existing installation \
of the Client.$\nPlease uninstall the existing version and run the installer again by \
clicking on $\"Ok$\" or click on $\"Cancel$\" to abort this installation." \
/SD IDOK IDOK QuietUninstall IDCANCEL
Goto done
QuietUninstall:
ExecWait '"$INSTDIR\uninstall.exe" /S _=$INSTDIR'
Goto done
done:
abort
FunctionEnd
The reason for this is that the installer when on a clean install, it creates a folder and shares it on the network. Then installs a service and starts it after everything is installed.
When uninstall runs, the network shared file un-shares and is deleted, then it stops and uninstalls an installed service and it will remove the remaining files after a reboot (or, at least, the files cannot be unwritten or deleted until the service has fully stopped and uninstalled and I haven't found a way to set a time delay to wait for the service to stop yet)
So what happens now, if someone re-runs the installer again and goes to the point where it begins copying files to the install directory, it gets a file write error as the folder may be connected to by other computers on the network and the service is also still running.
Re-Running the setup is a needed ability to both easily be able to uninstall it (for the less computer literate) and also be able to modify a configuration file using the ReplaceInFile method when a user on a custom page, which has a drop down menu, makes a particular selection then passes it to the leave page that changes the environment of the installed client.
What might you recommend the approach to this might be? Am I on the right track?
I am definitely newer to using NSIS, but I have been able to get a lot out of the support system here and I thank you all for that!