peter931
18th July 2007 20:21 UTC
two installDirs possible ?
Hello,
I want have two install-Dirs, that are editable by the user.
One part of Software should be installt to
c:\xxxxxx
the other part to
d:\yyyyyy
Both pathes must be overrideable by the user.
Is there any example available?
Thanks
Peter
sgiusto
18th July 2007 21:09 UTC
simply add a PagEx of type directory to your installer:
PageEx directory
DirText $(EXTRADIR_CAPTION)
DirVar $EXTRA_DIR
PageExEnd
then in .onInit you can read the values from previous installations or set to default like these:
Function .onInit
; this is the for the standard dir page
StrCpy $INSTDIR "$PROGRAMFILES\Myprg\"
; this is for the extra page
StrCpy $EXTRA_DIR "$PROGRAMFILES\Extra\"
FunctionEnd
hope this helps
Afrow UK
19th July 2007 01:30 UTC
Or if you are using Modern UI, simply add !define MUI_DIRECTORYPAGE_VARIABLE $Var before your second MUI_PAGE_DIRECTORY insertion.
Stu
peter931
19th July 2007 10:19 UTC
I would like to use the modern Interface.
The hint to use a second Page is working well.
But is it also possibble to input both
directories on ONE page?
This would be easier for the user.
Thanks for help
Peter
Red Wine
19th July 2007 10:53 UTC
You'd need to build a custom page with 2 DirRequest fields.
DrDan
1st August 2007 11:27 UTC
Three directories...
I had to do this for our installer too. Except we had three locations.
It's quite easy if you use Eclipse and the NSIS plug-in for Eclipse - it's very good and lets you draw custom pages (like you might do in MS visual studio).
pchris
12th August 2007 18:08 UTC
Hello!
I have a follow-up question:
I have also two parts of the software which should go in different directories. But one part is optional, so the second DirPage should only be shown when the section is choosen in the ComponentPage.
How to make that?
mfg
chris