Archive: 2 intances of a file


2 intances of a file
Hey, I am very new to Nsis. I am currently reading the doc. but need a quick sollution.. In my install script users can choose if the app should be autostarted. I want to use different "config file" (for my app) if the user choose "Yes" or "No". Can I store 2 different instances of a files in the setup exe and then copy the correct config if Yes or No is choosen?

If YES is choosed config1 should be installed.
If NO is choosed config2 should be installed.

Its one line in my config file that is different if the app is autostarted. Maybe this line could be changed instead?

Skanky


Something like this:


MessageBox MB_YESNO "Do you want to use configuration 1?" IDYES File1 IDNO File2

file1:
; extract file #1:
File "/oname=$INSTDIR\file1.config"
goto end

; extract file #2:
file2:
File "/oname=$INSTDIR\file2.config"

end:
### Launch your application here ###


Or, using the same general logic, you could just as easily modify your config file. If your config file is an INI-type file, use WriteIniStr. If not, have a look at the docs under appendix E, "Text functions header". There, you'll find a ConfigWrite or ConfigWriteS function. (The "S" version can be used if you need a case-sensitive config file.)