Archive: Change $INSTDIR multiple times ?


Change $INSTDIR multiple times ?
Is it possible to change the variable $INSTDIR at several places.
The changes should be effective for the rest of the install procedure.
It should look like:

InstallDir "C:\mypath"

Section "one"
SetOutPath $INSTDIR ; OutPath should point to "C:\myPath"
InstallDir "C:\otherpath"
File blah.txt ; File should be extracted to C:\mypath\blah.txt
SetOutPath $INSTDIR ; OutPath should point to "C:\otherpath"
File qqq.txt ; File should be extracted to C:\otherpath\qqq.txt
...
SectionEnd

Section "Two"
File aa.txt ; File should be extracted to C:\otherpath\aa.txt
InstallDir "C:\pppp"
SetOutPath $INSTDIR ; OutPath should point to "C:\pppp"
...
SectionEnd

...


InstallDir itself can only be used once but SetOutPath can be used as many times as you wish and not only with $INSTDIR as its parameter. You can use something like this:

SetOutPath $INSTDIR
File bla.txt
SetOutPath $INSTDIR\subdir
File foo.exe
SetOutPath C:\pppp
File bar.exe