Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
219 views
in Technique[技术] by (71.8m points)

c# - Merge msi and exe

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...