Merge msi and exe
Asked Answered
L

3

31

My deployment project creates and .msi-file and an .exe-file. Is it possible to merge these into one .exe?

Lemon answered 11/2, 2009 at 8:55 Comment(0)
C
26

Yes, you can create a self-extracting installer containing both MSI and the setup.exe bootstrapper file.

I think it is possible to do that with WinZip, or you can use IExpress coming with Windows. Here is a guide how to create a self-extracting executable with IExpress. You can either use the IExpress wizard or manually write a config file which you then can execute in the post-built step of your setup project, e.g. by calling

IExpress /N /Q MySetup.sed

A sample configuration file would look like this:

[Version]
Class=IEXPRESS
SEDVersion=3
[Options]
PackagePurpose=InstallApp
ShowInstallProgramWindow=1
HideExtractAnimation=1
UseLongFileName=1
InsideCompressed=0
CAB_FixedSize=0
CAB_ResvCodeSigning=0
RebootMode=N
InstallPrompt=%InstallPrompt%
DisplayLicense=%DisplayLicense%
FinishMessage=%FinishMessage%
TargetName=%TargetName%
FriendlyName=%FriendlyName%
AppLaunched=%AppLaunched%
PostInstallCmd=%PostInstallCmd%
AdminQuietInstCmd=%AdminQuietInstCmd%
UserQuietInstCmd=%UserQuietInstCmd%
SourceFiles=SourceFiles
[Strings]
InstallPrompt=
DisplayLicense=
FinishMessage=
TargetName=MySetup.exe
FriendlyName=My cool application
AppLaunched=CMD /C setup.exe
PostInstallCmd=
AdminQuietInstCmd=
UserQuietInstCmd=
FILE0="setup.exe"
FILE1="MySetup.msi"
[SourceFiles]
SourceFiles0=
[SourceFiles0]
%FILE0%=
%FILE1%=

There is a little caveat however with the self-extracting installer scenarios. Due to another fix these scenarios are broken with the bootstrapper (setup.exe) created by VS2008 SP1. For a workaround see the following thread: http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/3731985c-d9cc-4403-ab7d-992a0971f686/?ffpr=0.

Confocal answered 11/2, 2009 at 9:17 Comment(6)
Yes, it doesn't work due to a bug. See the link that I have posted (social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/…) for a workaround.Confocal
The PostInstallCmd line in [Strings] should read PostInstallCmd=<None>, otherwise it will give you an "error creating process" message when installation completes.Dustindustman
where exactly do you write the configuration file ? i tried IExress but the setup.exe couldn't find setup.msi isn't it supposed to extract them in the same place and then run the setup.exe ? when using IExpress do i need to change anything in the .csproj file?Tyrannize
@chris deneb: There is no need to modify the .csproj file (unless you add the call of iexpress to a post-build step). Usually, both files are extracted to the same folder somewhere below your %TMP% folder. Did you read the note about the caveat with VS2008 SP1?Confocal
i failed to do this with winzip however i finally managed to merge msi and exe with Iexpress, really nice tool. yes i saw it thanks to Phylliss answer i did it! only difference i included a setup.cmd batch file that installs windows imaging component, in case the user has a pc with... lets say a fresh install of xp, just to cover all dependencies that might appear. thanks for the response!Tyrannize
Great solution. The resulting setup I made with this was showing an error executing the PostInstallCmd. Fixed it by setting PostInstallCmd=<None>Squabble
E
2

I like it, you can see how to use IExpress on this link!

The only problem I see was that I've generated a installer on Windows Vista 64bits, I was trying to install the generated .exe in a server with Windows Server 2008 32bits, but it throws an error about processor type.

Emmerie answered 10/10, 2009 at 16:25 Comment(1)
I ran into this as well, you can fix it by running C:\Windows\SysWoW64\IExpress.exe instead of the one in C:\Windows\System32. That way it will always generate a 32-bit exe.Dustindustman
S
1

Another option could be 7zip with sfx plugin: http://www.7-zip.org/download.html or WinZip self extractor: http://www.winzip.com/prodpagese.htm

Soper answered 14/11, 2011 at 8:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.