- NSIS Discussion
- NSIS target version information?
Archive: NSIS target version information?
cnthomas16
28th January 2003 22:49 UTC
NSIS target version information?
Anyone have any idea what it would take to add version resource information to the .exe that makesnis produces? I saw a previous thread that mentioned this feature was 'not ready yet' sometime last year.
I attempted to write the version info to the binary after it was created but then all the internal checksum validations failed which made this a no-go.
I love this installer, coming from the InstallShield world this lightweight simpleness is outstanding. All I need to make this installer usable for me is this feature. I'm happy to lend a hand, I poked around in the code a bit, tried writing a VS_FIXEDVERSIONINFO block to the resources but didn't have much luck in getting it to work right.
-Chris
rainwater
29th January 2003 01:25 UTC
I believe you will want to use !packhdr to add the source. This way it will not fail any checksum.
kichik
29th January 2003 14:15 UTC
I plan on adding this feature to b2. b1 is coming out so it shouldn't be too long... If you want to add it yourself look in Source\Build.cpp line 1505 for an example.
cnthomas16
29th January 2003 19:20 UTC
rainwater, can you clarify how I might use !packhdr to insert version information into the binary during build time? or perhaps fix the header in the .exe I modified after the fact.
rtfm'ing, I get the impression this command is used for something different.
Joel
29th January 2003 19:38 UTC
EXE created by the installer is like the one of WinZIP self extractor, You can't change the info binary because, like an older post, the'll be a checksum error....
If you are trying to put info. like exe version, product version, etc., it have to be from the source code of Makensis... so you have to rebuild the source code to put this info on.
kichik
29th January 2003 19:53 UTC
Not so accurate... That's not the only way. The second way is !packhdr which tells makensis to run a program such as UPX before it calculates the checksum. It was originally designed for EXE compressors but it can be used for this purpose too if you create a program that adds version information.
Joel
29th January 2003 21:39 UTC
Than !packhdr is a way to add some binary info. in the installer? Let me try it.... :P
I'm too was wondering if that I can add some info the EXE installer...
kichik
29th January 2003 21:57 UTC
It lets you run a program that will alter the exe header but it doesn't alter the exe header on its own. You'll have to write a program that changes the resource and adds version information and run it with !packhdr. Only this way the CRC (checksum) will be right.
Joel
29th January 2003 22:12 UTC
Ok, I downloaded the UPX... I put this in the script:
!packhdr "temp.dat" "${dirico}\upx.exe -9 temp.dat"
;where ${dirico}\upx.exe is my path for the upx.exe
Ok, tested and it not return error, that's great, but the temp.dat.. it suppose the have the info header? How can I make the .dat?
rainwater
29th January 2003 22:55 UTC
Originally posted by dark_boy
Ok, I downloaded the UPX... I put this in the script:
!packhdr "temp.dat" "${dirico}\upx.exe -9 temp.dat"
;where ${dirico}\upx.exe is my path for the upx.exe
Ok, tested and it not return error, that's great, but the temp.dat.. it suppose the have the info header? How can I make the .dat?
The temp.dat is created automatically (thats the header). Upx runs on it, and it will be deleted.
cnthomas16
29th January 2003 22:57 UTC
I am using rsrc.exe from the rsxnt tools for adding version info to the binary, adding the line:
!packhdr temp.exe "rsrc.exe verinfo.res temp.exe"
Im assuming the makensis writes out the temp file for modification, reads it back, then writes the final output, but I can't get it to work either. I don't believe my paths are an issue, everything is one directory.
I can't use .dat because the utility only works on .exe files. So when I get to the end of the build, the compiler complins with the msg:
Generating language tables... Done!
update .rsrc section
Finding icons offsets for uninstaller...
generate_unicons_offsets: no icons?! -- failing!
Error - aborting creation process
Hmmmm....
kichik
30th January 2003 10:11 UTC
dark_boy, UPX is an EXE compressor, it doesn't add version information. I gave it as an example usage of !packhdr.
cnthomas16, according to the error there rsrc removed the icons from the exe header. It seems like it replaced all of the resources with the resources in verinfo.res. I couldn't find the program online so I can't test this, but there must be some way to tell it to add rather than replace.
virtlink
30th January 2003 11:23 UTC
For now, I think that you should use ResHack to edit the version info and just wait for NSIS 2b2.
Joel
30th January 2003 21:10 UTC
Well...
oops, sorry dudes ! :D
I'll just wait for the feature to be added...
but still cool extra compressor :p
cnthomas16
31st January 2003 01:33 UTC
Of course, that now makes sense with the icon, rsrc did replace all the resources.
Thanks for the great feedback, I'm looking forward to b2. Keep up the great work, NSIS is awesome, it fills a huge void for lightweight installs. I'd like to be able to contribute to this great cause somewhere down the road when I get my head above water.
I'll go check out ResHack, it just might do for now.