Old 19th November 2006, 22:26   #1
Jamyn
Junior Member
 
Join Date: Aug 2002
Location: Texas
Posts: 36
Commandline Extract .nsi?

Hi all,

I'm having a bit of difficulty creating a "hidden" section that extracts the .nsi files when presented with a commandline option. Basically, I want to bundle the .nsi files with the installer, and if I run setup.exe /WITHSOURCE or something, it also extracts the .nsi files to the install dir.

Putting together the three required pieces into a working solution is giving me trouble.

1) disable the hidden "extract source" section by default.
2) check commandline for /WITHSOURCE, re-enable the hidden section that extracts the source if the commandline option was there.
3) extract the source. I dont really need it to extract a full source, just the original .nsi file.

Has anyone done something like this in their installer, and could give me a tip, pointers, or an example? I greatly appreciate it.
Jamyn is offline   Reply With Quote
Old 19th November 2006, 22:59   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
1) /o switch as specified in the documentation.
2) See GetOptions in the documentation.
3) Use the SelectSection macro in Sections.nsh

-Stu
Afrow UK is offline   Reply With Quote
Old 19th November 2006, 23:10   #3
Jamyn
Junior Member
 
Join Date: Aug 2002
Location: Texas
Posts: 36
Thank you Stu.
Jamyn is offline   Reply With Quote
Old 20th November 2006, 10:29   #4
niteflyer
Member
 
Join Date: Mar 2004
Posts: 73
I have something similar implemented with nfUtils.nsh (http://nsis.sourceforge.net/NfUtils_header_file). ${nfu.ProcessStdSwitches} checks for a /X or /E switch, which lets you extract or explore files which you have included with the macro ${nfu.!AddFile} to your setup.exe without actually running your sections.

Have a look at the installer for the header (nfUtils.nsi) for examples.
niteflyer 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