Old 26th September 2006, 22:41   #1
Skankyz
Junior Member
 
Join Date: Sep 2006
Posts: 1
Question 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
Skankyz is offline   Reply With Quote
Old 27th September 2006, 05:13   #2
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
Something like this:
code:

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.)
Comperio is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump