Archive: installation to several directories


installation to several directories
  I have an appication that needs several directories to be chosen by the user/installer. Is this possible to do with nsis? Or is it limited to only one target folder?

Regards,

Snorre


http://forums.winamp.com/showthread....hreadid=109352

Use InstallOptions. InstallOptions gives you the ability to create custom pages during installation. It can also get input for you such as another directory.

If you want to show one custom page right after the other use MultIni4 or the new macros in the modern UI (avaiable in the latest CVS version).

Exelent. The InstallOptions.dll worked fine for me. Now I've got a few followups that you might know the answer to:

1) Is it possible to set the default value of the installOptions elements from the main script or the ini file?
2) Is it possible to remove the standard output dir page?
3) Can you refer to a page where the MultIni4 function is described? cant find anything about it.

Thank you for your help.

Regards,

Snorre


1) Yes, because NSIS have INI files handing capabilities you can write to the INI file and change certain fields such as State and Text and thus dynamically editing the custom page. For more info about fields in the INI file consult the IO readme file (Install Options.html).
2) Yes, just don't use DirText in your script.
3) Well,

The best documentation in this case is the script files themselves. They are well documented and unless you are the curious type in order to use their technique you don't need to actually read most of their script, you just have to use it and that thankfully is simplicity itself ;-)
The script files contain some comments that might help. Most of them are in CustomPages.nsh in the ZIP file.

If you are using the Modern UI, you can use the InstallOptions macro's. Have a look at Examples\Modern UI\InstallOptions.nsi


Thank you very much for your help guys. My install script is now almost done, in beautify Modern UI :) The only thing I did'nt seem to be able to do was to move the installoption.dll to another folder than the Plugins folder. I want to be able to store everything that I need to build a distribution in my CVS tree so that I dont have to install NSIS on all computers I work on. I managed to move all other included files (language files, system) but when i move the installoption.dll makensis complains that there is no function installOptions::dialog. Any solutions to this? It's no big issue, just got curious as to why I cant move this file.


Use PluginDir to give NSIS another folder to search for plug-ins.


PluginDir "C:\\MyProj\\plugins"

>Section
; ...
InstallOptions::dialog ; bla bla
; ...
>SectionEnd
>

Is there a way to change the "..." to "Browse" on a dirrequest install options field?


I don't know, maybe using the "Text=" value


No, you can't. But a lot have changed in the past half a year :)
You can use two Page dir commands, the first of them with a leave callback function that will copy $INSTDIR into another variable so you'll have one directory in that variable and one in $INSTDIR.

For example:

Page directory "" setTexts getInstDir
Page directory

Function setTexts
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $0 1006
SendMessage $1 ${WM_SETTEXT} 0 \
"STR:Another text for the first directory page instead of DirText"
FunctionEnd

Function getInstDir
StrCpy $R9 $INSTDIR
FunctionEnd

Can I call the second dir page dynamically, from within a section?


No, and you can do that with InstallOptions pages (unless you're using 1.98 or 2.0a*). But you can skip the page from the pre-function using Abort.


I am trying to do this now with InstallOptions.. If I try to show a custom page from my second section (once the first section's files have already been installed), clicking next on the custom page will pass the path I need in that section succesfully, and the remaining files are installed correctly, but the custom page remains (instead of the finish page being displayed):

InstallOptions::show $PLUGINSDIR\customPage.ini
Pop $R0
MessageBox MB_OK "The user choose: $R0" IDOK

I'm using v2.0b4 cvs. What am I doing wrong?


Missed the not :(

You can NOT do this with InstallOptions pages - you can't show InstallOptions pages inside a section.