Old 8th June 2010, 17:04   #1
Zinthose
Senior Member
 
Join Date: May 2009
Posts: 152
Simple Tip To Add NSIS Source to Package

For those of you that love open source or just need a simple way to include the source code for your packages.

Just add this to the end of all your packages. It will be included as a file resource and if you use 7zip to extract your package you will find your source included. It's very basic but works great if you don't rely on a lot of custom includes.

PHP Code:
Section /-SourceCode
    File 
`${__FILE__}`
SectionEnd 
Enjoy
Zinthose is offline   Reply With Quote
Old 8th June 2010, 17:29   #2
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 304
Personally, I use the similar following trick instead :
PHP Code:
Goto +2
File 
"myfile.nsi" 
Wizou is offline   Reply With Quote
Old 8th June 2010, 18:00   #3
Zinthose
Senior Member
 
Join Date: May 2009
Posts: 152
Quote:
Originally Posted by Wizou View Post
PHP Code:
Goto +2
File 
"myfile.nsi" 
Ah nice, with the goto added it assures that it will never be extracted. Nice trick
Zinthose is offline   Reply With Quote
Old 8th June 2010, 20:45   #4
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
I put my source in with code like this:
code:
Function .oninit
...
SetOutPath $PLUGINSDIR\Src
File ${__FILE__}
File buildnum.nsh
File ...
SetOutPath $Temp ; don't leave working dir in $Pluginsdir or it can't be deleted
FunctionEnd


This allows me to get the source from %temp%\ns????.tmp\Src without using 7-zip. Then the source will be deleted after the installer finishes.
demiller9 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