Get msi install working. Needs .enbx extension working better.

This commit is contained in:
Tim Young 2017-07-28 18:06:21 -05:00
parent 889cb7f0c2
commit 5db0ffac9d
4 changed files with 109 additions and 8 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\WiX.3.11.0\build\wix.props" Condition="Exists('..\packages\WiX.3.11.0\build\wix.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
@ -8,6 +9,8 @@
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<OutputName>EduNetworkBuilderSetup</OutputName> <OutputName>EduNetworkBuilderSetup</OutputName>
<OutputType>Package</OutputType> <OutputType>Package</OutputType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath> <OutputPath>bin\$(Configuration)\</OutputPath>
@ -21,11 +24,30 @@
<ItemGroup> <ItemGroup>
<Compile Include="Product.wxs" /> <Compile Include="Product.wxs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EduNetworkBuilder\EduNetworkBuilder.csproj">
<Name>EduNetworkBuilder</Name>
<Project>{5662a48f-e771-4c29-b120-54d65fbc4a14}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
</ItemGroup>
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " /> <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') " /> <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' "> <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/" /> <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> </Target>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\WiX.3.11.0\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WiX.3.11.0\build\wix.props'))" />
</Target>
<!-- <!--
To modify your build process, add your task inside one of the targets below and uncomment it. 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. Other similar extension points exist, see Wix.targets.

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="EduNetworkBuilder" Language="1033" Version="1.0.0.33" Manufacturer="EduNetworkBuilder" UpgradeCode="ff6bf7dd-e8cc-426b-9b10-981a3b7196fd">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="EduNetworkBuilder" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="ApplicationShortcut" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<!-- Add info for program-files location -->
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="EduNetworkBuilder" />
</Directory>
<!-- Add info for the start-menu shortcut -->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="EduNetworkBuilder"/>
</Directory>
</Directory>
</Fragment>
<Fragment>
<!-- More for the start-menu shortcut -->
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="ff6bf7dd-e8cc-426b-9b10-981a3b7196fd">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="EduNetworkBuilder"
Description="A program for teaching networking"
Target="[#EduNetworkBuilder.exe]"
WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\EduNetworkBuilder" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="ProductComponent">
<File Source="$(var.EduNetworkBuilder.TargetPath)" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

View File

@ -1,30 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="EduNetworkBuilderSetup" Language="1033" Version="1.0.0.33" Manufacturer="EduNetworkBuilder" UpgradeCode="ff6bf7dd-e8cc-426b-9b10-981a3b7196fd"> <Product Id="*" Name="EduNetworkBuilder" Language="1033" Version="1.0.0.33" Manufacturer="EduNetworkBuilder" UpgradeCode="ff6bf7dd-e8cc-426b-9b10-981a3b7196fd">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate /> <MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="EduNetworkBuilderSetup" Level="1"> <Feature Id="ProductFeature" Title="EduNetworkBuilder" Level="1">
<ComponentGroupRef Id="ProductComponents" /> <ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="ApplicationShortcut" />
</Feature> </Feature>
</Product> </Product>
<Fragment> <Fragment>
<Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="TARGETDIR" Name="SourceDir">
<!-- Add info for program-files location -->
<Directory Id="ProgramFilesFolder"> <Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="EduNetworkBuilderSetup" /> <Directory Id="INSTALLFOLDER" Name="EduNetworkBuilder" />
</Directory> </Directory>
</Directory> <!-- Add info for the start-menu shortcut -->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="EduNetworkBuilder"/>
</Directory>
</Directory>
</Fragment> </Fragment>
<Fragment>
<!-- More for the start-menu shortcut -->
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="ff6bf7dd-e8cc-426b-9b10-981a3b7196fd">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="EduNetworkBuilder"
Description="A program for teaching networking"
Target="[#EduNetworkBuilder.exe]"
WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\EduNetworkBuilder" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
</Fragment>
<Fragment> <Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --> <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent"> --> <Component Id="ProductComponent">
<!-- TODO: Insert files, registry keys, and other resources here. --> <File Source="$(var.EduNetworkBuilder.TargetPath)" />
<!-- </Component> --> <Extension Id="enbx">
<Verb Id ="open" Command="open" TargetFile="EduNetworkBuilder.exe" Argument="&quot;%1&quot;"/>
</Extension>
</Component>
</ComponentGroup> </ComponentGroup>
</Fragment> </Fragment>
</Wix> </Wix>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="WiX" version="3.11.0" />
</packages>