gustavo-serra
3rd September 2007 14:48 UTC
Install directory dialog
Hello,
I have searched in the forum, FAQ, etc, but could not find a solution to my problem.
Most clients, that use the installer, use the default installation top directory (C:\). However, a few need to change this top directory to D: or even a directory (like E:\system\deploy).
In the installation procedure that problem would be easy to solve. I could show a page with a button that shows a directory dialog, as I have seen in the examples directory shiped with NSIS.
But, after the first install, users need only to upgrade (this is performed many times). In the upgrader (a completely different program) I would like to check if the default directory was used in the installation, if not, then use a dialog to let the user choose the correct directory.
I could use the Windows registry to save the installation dir, but most clients never use the installer (and this is desired, the possibility to not use the installer).
I could resume the question like this: How to create an if statement that shows a choose directory dialog
Thanks for the attention, and sorry for typing too much text. Any help is appreciated.
Wizou
3rd September 2007 14:54 UTC
If they don't use the installer, how do they install ? Direct unzipping somewhere ? And in this case, you don't have a way to know where they did unzip the application ?
gustavo-serra
3rd September 2007 15:02 UTC
Hi, thanks for the reply.
The answer is: yes. The installer is quite recent in my company. Most clients installed the application in the old fashion. I could not distribute the installer instead of the upgrader for some reasons:
- Installer is much bigger due to support third-party software
- They do different things (installer create databases, create users, create services)
I could use a page with the directory button always, but I would like to make the upgrader the most automatic as possible (nowdays the user just run it and receive a confirmation message if everything was ok, it is fully automatic).
Thanks.
Wizou
3rd September 2007 15:51 UTC
You didn't answer my second question..
If the user installed the application manually by unzipping it, how will you know the application folder ?
gustavo-serra
3rd September 2007 15:54 UTC
Oh, sorry.
There is a default installation directory. I would check if this directory is created. If the directory is not there, then I could not know where the user unzipped, that is the reason I need the browser dialog.
Wizou
4th September 2007 13:58 UTC
alright, then I would suggest in your Upgrader that you use
InstallDir with that default directory
In the "pre" function for the directory page, you could check if the files have already been installed at the $INSTDIR location (the default directory).
If yes, you could skip the directory page by using Abort
gustavo-serra
4th September 2007 20:37 UTC
Thanks, I search for the abort function and saw this:
Skipping Pages
Thanks so much. :-)