Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Creating a WIX Installer for ASP.NET Web Applications

, 12 Nov 2010
Example of creating a WIX installer for an ASP.NET Web application.
installer.zip
installer
MyWeb
MyWeb
App_Data
bin
MyWeb.dll
MyWeb.csproj.user
obj
Debug
TempPE
Release
Properties
MyWeb.gpState
MyWeb.sln.cache
setup
bin
release
build_setup.build
ConfigurationInitialize.wxi
IisConfiguration.wxs
License.rtf
MyWebUI.wxs
Product.wxs
UIDialogs.wxs
REM Setting variables...
REM Name of the folder where the 'publish' from msbuild target will be performed
set publishFolder=publish\
REM Remove complete publish folder in order to be sure that evrything will be newly compiled
rmdir /S /Q %publishFolder%
REM Rebuild entire solution
msbuild /p:Configuration=Release /t:ReBuild ..\MyWeb\MyWeb.sln
REM Publish your web site
msbuild /t:ResolveReferences;_CopyWebApplication /p:Configuration=Release;OutDir=..\..\Setup\%publishFolder%\bin\;WebProjectOutputDir=..\..\Setup\%publishFolder% ..\MyWeb\MyWeb\MyWeb.csproj
REM Delete debug and setup web.configs to prevent 'heat' from harveting it
del %publishFolder%web_setup.config
del %publishFolder%web.config
REM Harvest all content of published result
heat dir %publishFolder% -dr MYWEBWEBSITE -ke -srd -cg MyWebWebComponents -var var.publishDir -gg -out WebSiteContent.wxs
REM After the files are beeing harvested, copy the setup web.config as regular web.config back to publish location
copy /Y ..\MyWeb\MyWeb\Web_setup.config %publishFolder%Web.config
REM At last create an installer
candle -ext WixIISExtension -ext WixUtilExtension -ext WiXNetFxExtension -dpublishDir=%publishFolder% -dMyWebResourceDir=. IisConfiguration.wxs Product.wxs WebSiteContent.wxs UiDialogs.wxs MyWebUI.wxs
light -ext WixUIExtension -ext WixIISExtension -ext WixUtilExtension -ext WiXNetFxExtension -out bin\Release\MyWeb.Setup.msi Product.wixobj WebSiteContent.wixobj UiDialogs.wixobj MyWebUI.wixobj IisConfiguration.wixobj

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Petr Pechovic
Software Developer (Senior)
Czech Republic Czech Republic

| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 12 Nov 2010
Article Copyright 2010 by Petr Pechovic
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid