Macros to:
- add additional SupportedOS GUIDs to manifest
- add/overwrite/delete resources
- perform custom operations
- pack with UPX
Allows in-script combining of operations, without the need for external batch files.
Note: NSIS 2.x Unicode is not supported. I will add support if requested but it requires some workarounds and I didn't want to complicate the code needlessly. There are legitimate reasons for sticking with 2.46 until 3.0 is officially stable but it is not the case with Unicode fork, in my opinion.
HeadOp.nsh: exehead-related macros (manifest, resources, upx)
12 posts
For the sake of completeness I added 2.x Unicode support, as a separate nsh.
aerDNA
Thanks for HeadOp.nsh
Unfortunately, the program Resource Hacker only works well with .res files ...
Is it possible to add in HeadOp.nsh, convert script files .rc in .res ?
( for example, on the basis of utility brcc32.exe ? )
Thanks for HeadOp.nsh
Unfortunately, the program Resource Hacker only works well with .res files ...
Is it possible to add in HeadOp.nsh, convert script files .rc in .res ?
( for example, on the basis of utility brcc32.exe ? )
It requires .res for certain resource types like dialog. Why is that a problem? Do your editing in ResHacker and export as .res instead of .rc.
I must first edit the file .rc in stand-alone applications, and only then, change the resource ... We need a converter ...
Try this: before ${AddReplaceResource} use:
${CustomHeadOp} '"${ResHackerPath}" -extract ".rc path", ".res path", ,,'
${CustomHeadOp} '"${ResHackerPath}" -extract ".rc path", ".res path", ,,'
Update
I guess it can be handy to be able to edit a dialog in notepad while scripting so I added rc2res as a dedicated macro. Also added validation of paths along with some minor changes.
.nsh in the first post is 9926 bytes, which is the same as Win10 preview build number, so clearly it wasn't destined to be the final version. 🙂
I guess it can be handy to be able to edit a dialog in notepad while scripting so I added rc2res as a dedicated macro. Also added validation of paths along with some minor changes.
.nsh in the first post is 9926 bytes, which is the same as Win10 preview build number, so clearly it wasn't destined to be the final version. 🙂
Why do you need two separate versions?
Portions of code are different in HeadOp_246U, mainly beause !appendfile outputs unicode. I could cram it all up in one nsh with version checks but it's cleaner this way. Also, to keep in line with Unicode fork conventions, nsh is unicode.
!appendpost^ HeadOp_246U.nsh does Type File1 > File2 to convert !appendfile output to ansi. It works and I can't think of a real reason not to do it but it still feels sort of hacky.
To clarify for anyone who might be wondering, 'normal' nsh works perfectly fine in 3.0b1 with Unicode true. For unicode installers, 3.0 is what people should be using. As far as I'm concerned, Unicode fork was a pivotal step but is now deprecated. 3.0b1 has less issues (if any) even though it's officially still in beta.
To clarify for anyone who might be wondering, 'normal' nsh works perfectly fine in 3.0b1 with Unicode true. For unicode installers, 3.0 is what people should be using. As far as I'm concerned, Unicode fork was a pivotal step but is now deprecated. 3.0b1 has less issues (if any) even though it's officially still in beta.
Update
Nice to see ResHacker development resurrected but v4 broke rc2res macro.
Nice to see ResHacker development resurrected but v4 broke rc2res macro.
There were major changes to ResHacker command line syntax and HeadOp macros were broken as a result. I noticed this with only 2 years lag (better late than never).
Attached is the fixed version, for use with ResHacker v4.5.28 and newer.
Attached is the fixed version, for use with ResHacker v4.5.28 and newer.