Homeless
22nd April 2006 09:11 UTC
help for section on modern gui
Hi all,
I must insert 2 section only with this parameters:
OutFile "test.exe"
InstallDir "$PROGRAMFILES\Test1"
ShowInstDetails show
InstType "First option"
InstType "Second option"
Section "First Section" SEC01
SetOutPath "$INSTDIR"
SetOverwrite on
File "${NSISDIR}\test1.txt"
SectionEnd
Section "Second Section" SEC02
SetOutPath "$INSTDIR"
SetOverwrite on
File "${NSISDIR}\test2.txt"
SectionEnd
I dont understand the checked of options.
When i select First option the check box of section 1
must be checked and check box of section 2 not checked and of course disable.
When i select Second option the check of section 1 must be
not checked but enabled to checked and check box of section 2 checked and disabled.
There is also the possibility to change the destination path when the option i different?
If i select first option installdir must be:
InstallDir "$PROGRAMFILES\Test1"
If i select second option installdir must be:
InstallDir "$PROGRAMFILES\Test2"
Thanks a lot for help.
Thanks in advance.
HL
Joel
22nd April 2006 15:36 UTC
Yeah, it is possible, see one-section.nsi example
Homeless
23rd April 2006 11:27 UTC
Thanks a lot to reply my post.
I have another question:
I must check on registry that is installed Photoshop CS or Photoshop CS2, couse the path is different.
I have this code for CS2.
first
InstallDirRegKey HKLM "SOFTWARE\Adobe\Photoshop\9.0" "ApplicationPath"
and I think this in CS but not shure:
second
InstallDirRegKey HKLM "SOFTWARE\Adobe\Photoshop\8.0" "ApplicationPath"
So I must set the different path.
For example:
If Version is 9.0 put on the script the first InstallDirRegKey but the version is 8 put the second InstallDirRegKey
In this mode when the user install programm find always correct path.
Thanks a lot.
Homeless
Joel
23rd April 2006 14:50 UTC
Well...you can try not InstallDirRegKey and use ReadRegStr to read both paths, then use StrCmp, to see which paths exists
Homeless
23rd April 2006 15:55 UTC
Thanks a lot Joel,
If possible to have an example....
CancerFace
23rd April 2006 23:48 UTC
@Homeless
To check the registry for the correct version of photoshop installed (according to your info) try something along these lines:
ClearErrors
ReadRegStr $0 HKLM "SOFTWARE\Adobe\Photoshop\8.0" "ApplicationPath"
IfErrors CS9
; found version 8 $0 contains the 'ApplicationPath' value
...
Goto End
CS9:
ClearErrors
ReadRegStr $0 HKLM "SOFTWARE\Adobe\Photoshop\9.0" "ApplicationPath"
IfErrors NoVersion
; found version 9, $0 contains the 'ApplicationPath' value
...
Goto End
NoVerion:
DetailPrint "No version was found"
...
End:
Add your extra code instead of the '...'
CF
Homeless
24th April 2006 10:13 UTC
Thanks cancerface for help, but I dont understand while put the string of correct path on installdir.
I find correct path but the installdir is empty and after component window section the path is empty.
Thanks
Afrow UK
24th April 2006 11:44 UTC
To set the current InstallDir at run time, use
StrCpy $INSTDIR "$PROGRAMFILES\new_path"
-Stu