Archive: help for section on modern gui


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


Yeah, it is possible, see one-section.nsi example


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


Well...you can try not InstallDirRegKey and use ReadRegStr to read both paths, then use StrCmp, to see which paths exists


Thanks a lot Joel,

If possible to have an example....


@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

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


To set the current InstallDir at run time, use
StrCpy $INSTDIR "$PROGRAMFILES\new_path"

-Stu