This repository has been archived by the owner on Feb 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from robmen/wix311-template-fixes
Fix WiX v3.11 templates
- Loading branch information
Showing
34 changed files
with
311 additions
and
39 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
src/Templates/v3/Projects/CustomActionCPP/CustomAction.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include "stdafx.h" | ||
|
||
|
||
UINT __stdcall CustomAction1( | ||
MSIHANDLE hInstall | ||
) | ||
{ | ||
HRESULT hr = S_OK; | ||
UINT er = ERROR_SUCCESS; | ||
|
||
hr = WcaInitialize(hInstall, "CustomAction1"); | ||
ExitOnFailure(hr, "Failed to initialize"); | ||
|
||
WcaLog(LOGMSG_STANDARD, "Initialized."); | ||
|
||
// TODO: Add your custom action code here. | ||
|
||
|
||
LExit: | ||
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; | ||
return WcaFinalize(er); | ||
} | ||
|
||
|
||
// DllMain - Initialize and cleanup WiX custom action utils. | ||
extern "C" BOOL WINAPI DllMain( | ||
__in HINSTANCE hInst, | ||
__in ULONG ulReason, | ||
__in LPVOID | ||
) | ||
{ | ||
switch(ulReason) | ||
{ | ||
case DLL_PROCESS_ATTACH: | ||
WcaGlobalInitialize(hInst); | ||
break; | ||
|
||
case DLL_PROCESS_DETACH: | ||
WcaGlobalFinalize(); | ||
break; | ||
} | ||
|
||
return TRUE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
LIBRARY "$projectname$" | ||
|
||
EXPORTS | ||
CustomAction1 |
128 changes: 128 additions & 0 deletions
128
src/Templates/v3/Projects/CustomActionCPP/CustomAction.vcxproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Debug|Win32"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|Win32"> | ||
<Configuration>Release</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>{$guid1$}</ProjectGuid> | ||
<Keyword>Win32Proj</Keyword> | ||
<RootNamespace>$safeprojectname$</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<CharacterSet>Unicode</CharacterSet> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
</PropertyGroup> | ||
|
||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
|
||
<ImportGroup Label="ExtensionSettings"> | ||
</ImportGroup> | ||
|
||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
|
||
<PropertyGroup Label="UserMacros" /> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<OutDir>bin\$(Configuration)\</OutDir> | ||
<IntDir>obj\$(Configuration)\</IntDir> | ||
<LinkIncremental>true</LinkIncremental> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<OutDir>bin\$(Configuration)\</OutDir> | ||
<IntDir>obj\$(Configuration)\</IntDir> | ||
<LinkIncremental>false</LinkIncremental> | ||
</PropertyGroup> | ||
|
||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<ClCompile> | ||
<Optimization>Disabled</Optimization> | ||
<AdditionalIncludeDirectories>$(WIX)sdk\$(WixPlatformToolset)\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | ||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<MinimalRebuild>true</MinimalRebuild> | ||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | ||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> | ||
<PrecompiledHeader>Use</PrecompiledHeader> | ||
<WarningLevel>Level3</WarningLevel> | ||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat> | ||
</ClCompile> | ||
<Link> | ||
<AdditionalDependencies>msi.lib;dutil.lib;wcautil.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
<AdditionalLibraryDirectories>$(WIX)sdk\$(WixPlatformToolset)\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | ||
<ModuleDefinitionFile>CustomAction.def</ModuleDefinitionFile> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
<SubSystem>Windows</SubSystem> | ||
<TargetMachine>MachineX86</TargetMachine> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<ClCompile> | ||
<Optimization>MaxSpeed</Optimization> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<AdditionalIncludeDirectories>$(WIX)sdk\$(WixPlatformToolset)\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | ||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<PrecompiledHeader>Use</PrecompiledHeader> | ||
<WarningLevel>Level3</WarningLevel> | ||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> | ||
</ClCompile> | ||
<Link> | ||
<AdditionalDependencies>msi.lib;dutil.lib;wcautil.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
<AdditionalLibraryDirectories>$(WIX)sdk\$(WixPlatformToolset)\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | ||
<ModuleDefinitionFile>CustomAction.def</ModuleDefinitionFile> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
<SubSystem>Windows</SubSystem> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<TargetMachine>MachineX86</TargetMachine> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
|
||
<ItemGroup> | ||
<ClCompile Include="CustomAction.cpp" /> | ||
<ClCompile Include="stdafx.cpp"> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> | ||
</ClCompile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="CustomAction.def" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ClInclude Include="stdafx.h" /> | ||
<ClInclude Include="targetver.h" /> | ||
</ItemGroup> | ||
|
||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<Import Project="$(WixNativeCATargetsPath)" Condition=" '$(WixNativeCATargetsPath)' != '' " /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.NativeCA.targets" Condition=" '$(WixNativeCATargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.NativeCA.targets') " /> | ||
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixNativeCATargetsImported)' != '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> | ||
|
||
<ImportGroup Label="ExtensionTargets"> | ||
</ImportGroup> | ||
</Project> |
Binary file not shown.
25 changes: 25 additions & 0 deletions
25
src/Templates/v3/Projects/CustomActionCPP/CustomActionCPP.vstemplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<VSTemplate Version="3.0.0" Type="Project" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005"> | ||
<TemplateData> | ||
<Name _locID="TSDATA_DUT_Name">C++ Custom Action Project for WiX v3</Name> | ||
<Description _locID="TSDATA_DUT_Description">A project for creating an MSI custom action using WiX Toolset v3</Description> | ||
<Icon>CustomActionCPP.ico</Icon> | ||
<ProjectType>WiX</ProjectType> | ||
<TemplateID>Microsoft.Deployment.WindowsInstaller.CustomActionCPP</TemplateID> | ||
<RequiredFrameworkVersion>2.0</RequiredFrameworkVersion> | ||
<SortOrder>80</SortOrder> | ||
<NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp> | ||
<CreateNewFolder>true</CreateNewFolder> | ||
<DefaultName>CustomAction</DefaultName> | ||
<ProvideDefaultName>true</ProvideDefaultName> | ||
</TemplateData> | ||
<TemplateContent> | ||
<Project File="CustomAction.vcxproj" ReplaceParameters="true"> | ||
<ProjectItem ReplaceParameters="true" OpenInEditor="true">CustomAction.cpp</ProjectItem> | ||
<ProjectItem ReplaceParameters="true">CustomAction.def</ProjectItem> | ||
<ProjectItem ReplaceParameters="true">stdafx.cpp</ProjectItem> | ||
<ProjectItem>stdafx.h</ProjectItem> | ||
<ProjectItem>targetver.h</ProjectItem> | ||
</Project> | ||
</TemplateContent> | ||
</VSTemplate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "stdafx.h" | ||
|
||
// TODO: reference any additional headers you need in STDAFX.H | ||
// and not in this file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
#include "targetver.h" | ||
|
||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers | ||
// Windows Header Files: | ||
#include <windows.h> | ||
#include <strsafe.h> | ||
#include <msiquery.h> | ||
|
||
// WiX Header Files: | ||
#include <wcautil.h> | ||
|
||
|
||
// TODO: reference additional headers your program requires here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
#ifndef WINVER // Specifies that the minimum required platform is Windows XP. | ||
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. | ||
#endif | ||
|
||
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows XP. | ||
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. | ||
#endif | ||
|
||
#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 6.0 SP3. | ||
#define _WIN32_IE 0x0603 // Change this to the appropriate value to target other versions of IE. | ||
#endif | ||
|
||
#ifndef _WIN32_MSI // Specifies that the minimum required MSI version is MSI 3.1 | ||
#define _WIN32_MSI 310 // Change this to the appropriate value to target other versions of MSI. | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Templates/v3/Projects/CustomActionCS/CustomActionCS.vstemplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Templates/v3/Projects/CustomActionVB/CustomActionVB.vstemplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Templates/v3/Projects/WixBundleProject/WixBundle.vstemplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Templates/v3/Projects/WixMergeModule/WixMergeModule.vstemplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Templates/v4/Projects/CustomActionCS/CustomActionCS.vstemplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Templates/v4/Projects/CustomActionVB/CustomActionVB.vstemplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.