How to Unpackage and Repackage an exe (InnoSetup / InnoUnp on Windows)
Published 2013-4-16First off: My sincere apologies, this is a Windows tutorial. (I know, I know. I feel dirty too, but... what to do?)
InnoExtract isn't good enough
Although innoextract works well to extract files on OS X and Linux, it loses the metadata that would allow repacking.
InnoUnp
Anyway, I'll be using InnoUnp on Windows 8.
The nice things about Windows 8 are that it looks very clean -
like Redhat 9 back in 2004 -
and that it has PowerShell preinstalled,
which has commands like pushd
, ls
, and mv
that almost work the way you would expect.
7-zip
God is great, beer is good, and people are crazy.*
Now that Windows finally includes zip support by default
it's not cool anymore and everyone has moved to rar,
so you have to install 7-zip
(direct link)
to unpack innounp.exe
from innounp###.rar
... I'm sensing a definite irony that InnoUnp wasn't packaged with InnoSetup and can't be unpacked by itself.
Extracting an Installer
Extract the installer and not only will the paths be named after their internal
variable name ({path}/to/thing
), but you'll also get the much coveted install_script.iss
.
.\innounp.exe ExampleInstaller.exe -x -dExampleInstaller
ls .\ExampleInstaller
You'll see something like
{exampleinstaller}
install_script.iss
Repacking the Installer
In theory you can now repack your extracted installer using InnoSetup.
Just open the install_script.iss
with InnoSetup and recompile it.
Note that the [Files]
section will likely have been expanded from recursive directory
copying to actually listing each file individually.
See How to create an InnoSetup Installer
Appendix
ProTip:
Windows' start
is the companion to OS X's open
and Linux's xdg-open
If you want to install innoextract on OS X, I put the instructions in an issue on github.
By AJ ONeal
Did I make your day?
Buy me a coffee
(you can learn about the bigger picture I'm working towards on my patreon page )