Archive: Install directory dialog


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.


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 ?


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.


You didn't answer my second question..
If the user installed the application manually by unzipping it, how will you know the application folder ?


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.


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


Thanks, I search for the abort function and saw this:

Skipping Pages

Thanks so much. :-)