Bertrand_M23
31st January 2007 17:42 UTC
MUI_PAGE_DIRECTORY : customize "Destination folder"
Hello,
i would like to customize the destination folder of the "MUI_PAGE_DIRECTORY".
Here is my code :
Section
IfFileExists D:\*.* +1 nodiskD
CreateDirectory "D:\abracadabra"
iferrors nodiskD
RMDir /r "D:\abracadabra"
StrCpy $0 "D:\DKS"
;MessageBox MB_OK "$0"
goto +3
nodiskD:
;Default installation folder is windows' one
StrCpy $0 "%SYSTEMDRIVE%\DKS"
SectionEnd
InstallDir $0
But "InstallDir" doesn't work even with "$0" instead of $0
So here is my first questions :
Does anybody could tell my how to make my code works fine ???
I've found in that forum a way to customize the "MUI_PAGE_DIRECTORY" using "!define MUI_PAGE_CUSTOMFUNCTION_SHOW ShowDirectoryPage" as shown here :
http://forums.winamp.com/showthread.php?threadid=214898
But i didn't found any way to customize the "Destination folder".
So here ic mu second question :
How to customize the "Destination Folder" ?
Thanks for reading that topic ...
Bert
Bertrand_M23
31st January 2007 17:44 UTC
here the URL : "http://forums.winamp.com/showthread.php?threadid=214898"
Red Wine
31st January 2007 18:44 UTC
InstallDir is compile time instruction you can't set it at run time.
Yet, I can't understand exactly what you're doing in the section.
I you want to perform some action and set the $INSTDIR regarding to IfFileExists you need to do it in function .onInit.
What does mean customize destination folder?
Bertrand_M23
31st January 2007 19:12 UTC
In fact i had the destination folder shown in the specific page, if i write :
InstallDir "D:\Sample" : it works, but it's not so easy due to my check explained in my first topic.
If i do :
StrCmp $0 "D:\Sample"
InstallDir $0 : it doesn't work ... ;-(
And to respond to you : "Remark"
What i mean ... well ... from what i've found, it's possible to change text of that page so i thougth i could do the same with that section ... for example :
"GetDlgItem $1 $0 1023 ; IDC_SPACEREQUIRED
System::Call 'user32.dll::ShowWindow(i, i) v($1, 0)' :
this code allows to mask the space required information.
But if someone found the solution, my remark above is obsolete
Thanks to take time to read me ...
Bert
Red Wine
31st January 2007 19:49 UTC
You may want to read the manual 4.8.1.21 InstallDir
You can set the InstallDir at compile time and change it at run time within .onInit function e.g. StrCpy "$INSTDIR" "$0".
This wiki page might help you start dealing with ui controls and how you could change them at run time,
http://nsis.sourceforge.net/Demonstr...Pre_Show_Leave