Skip to content
Permalink
Browse files

add Wix toolset to generate MSI installer

  • Loading branch information...
xnum committed Nov 5, 2018
1 parent fefb715 commit 2c3c2f1ce1ec4a96c18b9e35f6eb420371705ece
Showing with 147 additions and 0 deletions.
  1. +19 −0 BeanfunLogin.sln
  2. +74 −0 WiX/Product.wxs
  3. +54 −0 WiX/WiXInstaller.wixproj
@@ -10,20 +10,39 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeanfunLogin", "BeanfunLogi
{0334B071-1FB1-4372-B500-4BC58A11EE59} = {0334B071-1FB1-4372-B500-4BC58A11EE59}
EndProjectSection
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "WiXInstaller", "WiX\WiXInstaller.wixproj", "{CD3DB338-6B72-454A-A665-B3886F5FE0B9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0334B071-1FB1-4372-B500-4BC58A11EE59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0334B071-1FB1-4372-B500-4BC58A11EE59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0334B071-1FB1-4372-B500-4BC58A11EE59}.Debug|x86.ActiveCfg = Debug|Any CPU
{0334B071-1FB1-4372-B500-4BC58A11EE59}.Debug|x86.Build.0 = Debug|Any CPU
{0334B071-1FB1-4372-B500-4BC58A11EE59}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0334B071-1FB1-4372-B500-4BC58A11EE59}.Release|Any CPU.Build.0 = Release|Any CPU
{0334B071-1FB1-4372-B500-4BC58A11EE59}.Release|x86.ActiveCfg = Release|Any CPU
{0334B071-1FB1-4372-B500-4BC58A11EE59}.Release|x86.Build.0 = Release|Any CPU
{AE885E1D-D21F-4810-9F82-EF797DD7845A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE885E1D-D21F-4810-9F82-EF797DD7845A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE885E1D-D21F-4810-9F82-EF797DD7845A}.Debug|x86.ActiveCfg = Debug|Any CPU
{AE885E1D-D21F-4810-9F82-EF797DD7845A}.Debug|x86.Build.0 = Debug|Any CPU
{AE885E1D-D21F-4810-9F82-EF797DD7845A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE885E1D-D21F-4810-9F82-EF797DD7845A}.Release|Any CPU.Build.0 = Release|Any CPU
{AE885E1D-D21F-4810-9F82-EF797DD7845A}.Release|x86.ActiveCfg = Release|Any CPU
{AE885E1D-D21F-4810-9F82-EF797DD7845A}.Release|x86.Build.0 = Release|Any CPU
{CD3DB338-6B72-454A-A665-B3886F5FE0B9}.Debug|Any CPU.ActiveCfg = Debug|x86
{CD3DB338-6B72-454A-A665-B3886F5FE0B9}.Debug|Any CPU.Build.0 = Debug|x86
{CD3DB338-6B72-454A-A665-B3886F5FE0B9}.Debug|x86.ActiveCfg = Debug|x86
{CD3DB338-6B72-454A-A665-B3886F5FE0B9}.Debug|x86.Build.0 = Debug|x86
{CD3DB338-6B72-454A-A665-B3886F5FE0B9}.Release|Any CPU.ActiveCfg = Release|x86
{CD3DB338-6B72-454A-A665-B3886F5FE0B9}.Release|x86.ActiveCfg = Release|x86
{CD3DB338-6B72-454A-A665-B3886F5FE0B9}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="*" Name="BeanfunLogin" Language="1033" Version="!(bind.FileVersion.BeanfunLogin.exe)" Manufacturer="xnum" UpgradeCode="3bd43aa7-e72c-449f-a70f-4caab9ca33d0">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<PropertyRef Id="NETFRAMEWORK45"/>

<Condition Message="This application is only supported on Windows 7 or higher.">
<![CDATA[Installed OR (VersionNT >= 601)]]>
</Condition>

<Condition Message="This application requires .NET Framework 4.5. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR NETFRAMEWORK45]]>
</Condition>

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />

<Feature Id="ProductFeature" Title="BeanfunLogin" Level="1">
<ComponentRef Id="BeanfunLogin.exe" />
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="ApplicationShortcutDesktop" />
</Feature>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="BeanfunLogin" />
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="BeanfunLogin"/>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
</Fragment>

<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="BeanfunLogin.exe" Guid="*">
<File Id="BeanfunLogin.exe" Source="$(var.BeanfunLogin.TargetPath)" KeyPath="yes" Checksum="yes"/>
</Component>
</DirectoryRef>
</Fragment>

<Fragment>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="*">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="BeanfunLogin"
Description="BeanfunLogin"
Target="[#BeanfunLogin.exe]"
WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
<Shortcut Id="UninstallProduct"
Name="Uninstall BeanfunLogin"
Description="Uninstall BeanfunLogin"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\BeanfunLogin" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationShortcutDesktop" Guid="5528fcaf-ab0c-4b5c-8db7-277e6b3d842f">
<Shortcut Id="ApplicationDesktopShortcut"
Name="BeanfunLogin"
Description="BeanfunLogin"
Target="[#BeanfunLogin.exe]"
WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
<RemoveFolder Id="RemoveDesktopFolder" Directory="DesktopFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\BeanfunLogin" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
</Fragment>
</Wix>
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>cd3db338-6b72-454a-a665-b3886f5fe0b9</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>BeanfunLogin</OutputName>
<OutputType>Package</OutputType>
<Name>WiXInstaller</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="Product.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BeanfunLogin\BeanfunLogin.csproj">
<Name>BeanfunLogin</Name>
<Project>{ae885e1d-d21f-4810-9f82-ef797dd7845a}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixNetFxExtension">
<HintPath>$(WixExtDir)\WixNetFxExtension.dll</HintPath>
<Name>WixNetFxExtension</Name>
</WixExtension>
</ItemGroup>
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

0 comments on commit 2c3c2f1

Please sign in to comment.
You can’t perform that action at this time.