We currently package Bitfighter for Windows using NSIS, and (sometimes) manually create a separate archive for running the game portably. I’m hoping to streamline the process to make building a portable version easier, thus encouraging us to do it regularly.
The current way we create our portable installs is to install the game normally (using the NSIS-built installer), then zip the install folder, and add a marker file called “portable.” I’d like to bypass the install step, and build the portable archive directly.
The main advantage of combining this with the NSIS installer is that it will streamline the build process, and will allow us to maintain a single list of files to be included.
Has anyone ever done anything like this?
In the end, I used a variation of the accepted answer, and used NSIS !ifdef directives to build two installers using the same codebase. By specifying /DPORTALBE, I will get a portable installer.
The code can be found in our Google Code repository.
Why not combine the normal and portable modes in one installer?
Or a simple version with no GUI support:
If you wanted to, you could probably create a setup that can generate the zip file:
mysetup.exe /GENERATEPORTABLEPKG=c:\path\to\7z.exeand then the setup would extract the files, useExecWaitto call 7zip and then clean up and exit…