Using WiX to make a C # application installation package

Source: Internet
Author: User
Tags cdata

1. Download and install wix3.9

From site: http://wixtoolset.org/releases/

2. Installation complete WiX, it can be used in vs2012.

3. Create a project

<?xml version= "1.0" encoding= "UTF-8"?> <wix xmlns= "Http://schemas.microsoft.com/wix/2006/wi" > <
           Product id= "4963aec3-4cd1-46c3-8986-07f9eb609cb6" upgradecode= "90bdb88b-2213-41ff-9de9-a5ec3c23d9c1" version= "1.0.0.1" codepage= "936" language= "2052" name= "Testcsharp" Manufactur Er= "Caiware" > <package Id = "{9c55b670-6180-430d-b47e-35c3d2540bf8}" installerversion= "Compres" Sed= "yes" installscope= "Permachine"/> <media id= "1" cabinet= "Testcsharp.cab" embedcab= "yes"/> <Proper Ty id= "Wixui_installdir" value= "Testcsharpdir"/> <property id= "qtexecdeferredexample" Value= "command line to RU N "/> <property id=" removepreviousversions value= ' True '/> <!--The following is to check if the. NET Framework is installed--> <propert Yref id= "Netframework40full"/> <propertyref id= "NETFRAMEWORK45"/> <condition message= ' This setup requ Ires Microsoft. NET Framework 4.0Full package or greater needs to is installed for this installation to continue. ' > <! [cdata[installed OR netframework40full]]> </Condition> <condition message= ' This setup requires Microso Ft. NET Framework 4.5 package or greater needs to is installed for this installation to continue. ' > <! [cdata[installed OR netframework45]]> </Condition> <!--The following is the creation of subdirectories in the target directory--> <directory I D= "TARGETDIR" name= "SourceDir" > <directory id= "ProgramFilesFolder" > <directory id= "Applicationro" Otdirectory "name=" Caiware "> <directory id=" testcsharpdir "name=" Testcsharp "> </directory&
        Gt 
        </Directory> </Directory> <!--directory of specified shortcuts--> <directory id= "ProgramMenuFolder" > <directory id= "Applicationprogramsfolder" name= "Caiware" > <directory id= "applicationfoldertest" CSharp "Name="Testcsharp"/> </Directory> </Directory> </Directory> <!--program Files\ca Iware\testcsharp--> <directoryref id= "Testcsharpdir" > <component id= "TestCS1.exe" guid= "{526A9833-3 EE5-429B-90A8-BCCE2566AEE4} "> <file id=" TestCS1.exe "source=" $ (var. SolutionDir) TestCS1.exe "keypath=" yes "/> </Component> </DirectoryRef> <!--add a shortcut --> <directoryref id= "Applicationprogramsfolder" > <component id= "applicationshortcut" Guid= "{A3E0B89 B-9958-437E-80F4-4C11EA61CEC9} "> <removefolder id=" applicationprogramsfolder "on=" Uninstall "/> &L T Registryvalue root= "HKCU" key= software\microsoft\caiware "name=" installed
      "Type=" integer "value=" 1 "keypath=" yes "/> </Component> </DirectoryRef> <directorYref id= "Applicationfoldertestcsharp" > <component id= "applicationtestshortcut" guid= "{ 
                  86c887f2-191b-4e2d-9301-795fe8c0e344} "> <shortcut id=" unisttestcsharp "name=" Uninstall " target= "[Systemfolder]msiexec.exe" arguments= "/x [ProductCode]" descript ion= "Uninstall"/> <removefolder id= "Applicationfoldertestcsharp" on= "Uninstall"/> UE root= "HKCU" key= "Software\microsoft\caiware\testcsharp" name= "Installed"
      "Type=" integer "value=" 1 "keypath=" yes "/> </Component> </DirectoryRef> <feature id= "MainApplication" title= "main Application" level= "1" > ;!
      --Program Files\caiware\testcsharp--> <componentref id= "TestCS1.exe"/> <!--Specify Shortcuts--> <componentref id= "Applicationshortcut"/> <componentref id=" applicationtestshortcut "/> </Feature> <wixvariable id=" Wixuilice Nsertf "value=" $ (var. SolutionDir) license.rtf "/> <!--<wixvariable id=" Wixuidialogbmp "value=" $ (var. SolutionDir) dialog.bmp "/>--> <!--<wixvariable id=" Wixuibannerbmp "value=" $ (var. SolutionDir) banner.bmp "/>--> <!--adds UI to the installation file and triggers the specified action from the UI. --> <UI> <uiref id= "Wixui_installdir"/> </UI> <!--This is the program that runs when the program is invoked and unloaded after installation-- > <InstallExecuteSequence> <removeexistingproducts after= "installinitialize"/> </inst
            allexecutesequence> <customaction id= "qtexecdeferredexample" binarykey= "Wixca" DllEntry= "CAQuietExec" Execute= "deferred" return= "check" impersonate= "no"/> </Product> </Wix>

If you write the above file, you can generate the appropriate installation package MSI file.

You can download the complete engineering files here:

http://download.csdn.net/detail/caimouse/9531732



Cai Junsheng qq:9073204 Shenzhen

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.