Using !packhdr: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
== !packhdr == | == !packhdr == | ||
!packhdr is a useful compile time directive which allows modifications to the built installer executable header before it is written to the finished installer executable file. | !packhdr is a useful compile time directive which allows modifications to the built installer executable header before it is written to the finished installer executable file. It can be used in conjunction with some useful batch files to: | ||
It can be used | |||
* Pack the header (UPX) | * Pack the header (UPX) | ||
* | * Remove the installer icon (Resource Hacker) | ||
* Add additional supported OS GUIDs for Windows 8 and above detection in NSIS 2.46* | |||
<br> | |||
''* Use the '''ManifestSupportedOS''' installer attribute in NSIS 3.0 for the same purpose.'' | |||
== Download == | |||
< | # Extract the contents of <attach>Packhdr.zip</attach> to your NSIS directory | ||
# Download [http://upx.sourceforge.net/#download UPX] and [http://angusj.com/resourcehacker/ Resource Hacker] and copy upx.exe and reshacker.exe to the NSIS\Packhdr folder | |||
</ | |||
upx | |||
== Usage == | == Usage == | ||
<highlight-nsis> | <highlight-nsis> | ||
!define Packhdr upx | !define Packhdr noicon+upx | ||
!define RequestExecutionLevel admin | |||
!include Packhdr.nsh | !include Packhdr.nsh | ||
</highlight-nsis> | </highlight-nsis> | ||
'''For all NSIS versions''' | |||
* ''!define Packhdr upx'' for all installers to reduce their header size. | |||
* ''!define Packhdr noicon+upx'' for installers or utilities written in NSIS that do not require an icon. | |||
* ''!define Packhdr noicon'' for when you do not require an icon and have appended client data to the end of the executable that you do not want to compress. | |||
'''For NSIS 2.46''' | |||
* ''!define RequestExecutionLevel admin'' is the same as using ''RequestExecutionLevel admin'' while also embedding the additional supported OS GUIDs. Other supported values are ''user'' and ''highest''. | |||
[[Category:Tutorials]] | [[Category:Tutorials]] |
Revision as of 15:30, 19 January 2014
Author: Afrow UK (talk, contrib) |
!packhdr
!packhdr is a useful compile time directive which allows modifications to the built installer executable header before it is written to the finished installer executable file. It can be used in conjunction with some useful batch files to:
- Pack the header (UPX)
- Remove the installer icon (Resource Hacker)
- Add additional supported OS GUIDs for Windows 8 and above detection in NSIS 2.46*
* Use the ManifestSupportedOS installer attribute in NSIS 3.0 for the same purpose.
Download
- Extract the contents of Packhdr.zip (2 KB) to your NSIS directory
- Download UPX and Resource Hacker and copy upx.exe and reshacker.exe to the NSIS\Packhdr folder
Usage
!define Packhdr noicon+upx !define RequestExecutionLevel admin !include Packhdr.nsh
For all NSIS versions
- !define Packhdr upx for all installers to reduce their header size.
- !define Packhdr noicon+upx for installers or utilities written in NSIS that do not require an icon.
- !define Packhdr noicon for when you do not require an icon and have appended client data to the end of the executable that you do not want to compress.
For NSIS 2.46
- !define RequestExecutionLevel admin is the same as using RequestExecutionLevel admin while also embedding the additional supported OS GUIDs. Other supported values are user and highest.