Is there a stripped down version of NSIS that doesn't require sections, pages, or other built in functions.
In other words, a generalized scripting system supporting all the NSIS great functions and plugins, but doesn't require the install domain specific sections, pages, or install specific callback functions.
The only required function would be main()
That'd be hot...
NSIS with main() function and no others or sections or pages?
7 posts
no, but then you can make a very minimal installer of the type you describe with just this:
Put the code you want in .onInit. The 'Abort' at the end will make the installer exit immediately, without any UI being loaded, etc. At the top you might still want to specify a compressor, but for the sake of minimalism.. the above is it.
OutFile "Setup.exe"
Section ""
SectionEnd
Function .onInit
; your code here
Abort
FunctionEnd
Or even shorter,
OutFile file.exe
SilentInstall silent
Section
...
SectionEnd
Stu
OutFile file.exe
SilentInstall silent
Section
...
SectionEnd
Stu
Afrow's solution also generates a smaller executable.
fancy 🙂
Silent installers get stripped of their resources and some language strings are also not included so the overhead is smaller.
And if you want it even smaller, you can use UPX to pack the overhead and then you can remove the icon with Resource Hacker, both by using !packhdr. You can't use !packhdr more than once so you need to use batch scripts.
Just to share with everyone, the batches I use in every installer I make:
NSIS\packhdr\upx.bat
Stu
Just to share with everyone, the batches I use in every installer I make:
NSIS\packhdr\upx.bat
NSIS\packhdr\noicon.bat
cd /d %~dp0
upx %1
NSIS\packhdr\noicon+upx.bat
cd /d %~dp0
ResHacker -delete %1, %1, icongroup,103,
del ResHacker.log
Example NSIS code to compress overhead and remove icon:
cd /d %~dp0
ResHacker -delete %1, %1, icongroup,103,
del ResHacker.log
upx %1
!packhdr $%TEMP%\exehead.tmp `"${NSISDIR}\packhdr\noicon+upx.bat" "$%TEMP%\exehead.tmp"`
You need to extract Resource Hacker and UPX to NSIS\packhdr as well of course.Stu