Jan Hudec
Jan Hudec

Reputation: 76386

How to add file to existing NSIS installer

I have an NSIS-generated installer and I need to create a new installer that is exactly the same, but has one extra file. What is the most direct way to do it? I would prefer if I didn't have to keep the NSIS scripts around. I have tried asking 7-Zip to simply add the file to the archive, but it says it does not support adding for this kind of archive.

I noticed this similar question, but the solution suggested there (to provide the files separately) is not an option, because the installer is for end users.

Upvotes: 1

Views: 2783

Answers (2)

Anders
Anders

Reputation: 101764

If you don't want to keep the .nsi you can store it in the installer instead

Section
goto +2
File "${__FILE__}"
SectionEnd

and just extract the .nsi with 7zip when you need to recompile...

Upvotes: 2

Slappy
Slappy

Reputation: 5472

7zip can extract files from [certain] NSIS installers but it cannot insert new ones. NSIS has specific structure and it is sophisticated system not only simple archive.

If you have script for an old installer that simply add new file to it and recompile installer from sources. There is no other simple way to do it.

Upvotes: 1

Related Questions