diff --git a/src/Templates/v3/Projects/CustomActionCPP/CustomAction.cpp b/src/Templates/v3/Projects/CustomActionCPP/CustomAction.cpp new file mode 100644 index 0000000..e06e7fd --- /dev/null +++ b/src/Templates/v3/Projects/CustomActionCPP/CustomAction.cpp @@ -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; +} diff --git a/src/Templates/v3/Projects/CustomActionCPP/CustomAction.def b/src/Templates/v3/Projects/CustomActionCPP/CustomAction.def new file mode 100644 index 0000000..a2da454 --- /dev/null +++ b/src/Templates/v3/Projects/CustomActionCPP/CustomAction.def @@ -0,0 +1,4 @@ +LIBRARY "$projectname$" + +EXPORTS + CustomAction1 diff --git a/src/Templates/v3/Projects/CustomActionCPP/CustomAction.vcxproj b/src/Templates/v3/Projects/CustomActionCPP/CustomAction.vcxproj new file mode 100644 index 0000000..b8829bc --- /dev/null +++ b/src/Templates/v3/Projects/CustomActionCPP/CustomAction.vcxproj @@ -0,0 +1,128 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + {$guid1$} + Win32Proj + $safeprojectname$ + + + + + + DynamicLibrary + Unicode + + + DynamicLibrary + Unicode + true + + + + + + + + + + + + + + + + + + bin\$(Configuration)\ + obj\$(Configuration)\ + true + + + bin\$(Configuration)\ + obj\$(Configuration)\ + false + + + + + Disabled + $(WIX)sdk\$(WixPlatformToolset)\inc;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Use + Level3 + EditAndContinue + + + msi.lib;dutil.lib;wcautil.lib;Version.lib;%(AdditionalDependencies) + $(WIX)sdk\$(WixPlatformToolset)\lib\x86;%(AdditionalLibraryDirectories) + CustomAction.def + true + Windows + MachineX86 + + + + + MaxSpeed + true + $(WIX)sdk\$(WixPlatformToolset)\inc;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + true + Use + Level3 + ProgramDatabase + + + msi.lib;dutil.lib;wcautil.lib;Version.lib;%(AdditionalDependencies) + $(WIX)sdk\$(WixPlatformToolset)\lib\x86;%(AdditionalLibraryDirectories) + CustomAction.def + true + Windows + true + true + MachineX86 + + + + + + + Create + Create + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Templates/v3/Projects/CustomActionCPP/CustomActionCPP.ico b/src/Templates/v3/Projects/CustomActionCPP/CustomActionCPP.ico new file mode 100644 index 0000000..1127647 Binary files /dev/null and b/src/Templates/v3/Projects/CustomActionCPP/CustomActionCPP.ico differ diff --git a/src/Templates/v3/Projects/CustomActionCPP/CustomActionCPP.vstemplate b/src/Templates/v3/Projects/CustomActionCPP/CustomActionCPP.vstemplate new file mode 100644 index 0000000..5e30f4c --- /dev/null +++ b/src/Templates/v3/Projects/CustomActionCPP/CustomActionCPP.vstemplate @@ -0,0 +1,25 @@ + + + + C++ Custom Action Project for WiX v3 + A project for creating an MSI custom action using WiX Toolset v3 + CustomActionCPP.ico + WiX + Microsoft.Deployment.WindowsInstaller.CustomActionCPP + 2.0 + 80 + 1 + true + CustomAction + true + + + + CustomAction.cpp + CustomAction.def + stdafx.cpp + stdafx.h + targetver.h + + + diff --git a/src/Templates/v3/Projects/CustomActionCPP/stdafx.cpp b/src/Templates/v3/Projects/CustomActionCPP/stdafx.cpp new file mode 100644 index 0000000..9a5cc24 --- /dev/null +++ b/src/Templates/v3/Projects/CustomActionCPP/stdafx.cpp @@ -0,0 +1,4 @@ +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/src/Templates/v3/Projects/CustomActionCPP/stdafx.h b/src/Templates/v3/Projects/CustomActionCPP/stdafx.h new file mode 100644 index 0000000..2a8fcf2 --- /dev/null +++ b/src/Templates/v3/Projects/CustomActionCPP/stdafx.h @@ -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 +#include +#include + +// WiX Header Files: +#include + + +// TODO: reference additional headers your program requires here diff --git a/src/Templates/v3/Projects/CustomActionCPP/targetver.h b/src/Templates/v3/Projects/CustomActionCPP/targetver.h new file mode 100644 index 0000000..c3a06de --- /dev/null +++ b/src/Templates/v3/Projects/CustomActionCPP/targetver.h @@ -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 diff --git a/src/Templates/v3/Projects/CustomActionCS/CustomAction.csproj b/src/Templates/v3/Projects/CustomActionCS/CustomAction.csproj index a9d91d2..261db17 100644 --- a/src/Templates/v3/Projects/CustomActionCS/CustomAction.csproj +++ b/src/Templates/v3/Projects/CustomActionCS/CustomAction.csproj @@ -53,6 +53,6 @@ - + diff --git a/src/Templates/v3/Projects/CustomActionCS/CustomActionCS.vstemplate b/src/Templates/v3/Projects/CustomActionCS/CustomActionCS.vstemplate index 6404ad3..b568c16 100644 --- a/src/Templates/v3/Projects/CustomActionCS/CustomActionCS.vstemplate +++ b/src/Templates/v3/Projects/CustomActionCS/CustomActionCS.vstemplate @@ -1,8 +1,8 @@  - C# Custom Action Project - A project for creating an MSI custom action + C# Custom Action Project for WiX v3 + A project for creating an MSI custom action using WiX Toolset v3 WiX Microsoft.Deployment.WindowsInstaller.CustomActionCS diff --git a/src/Templates/v3/Projects/CustomActionVB/CustomAction.vbproj b/src/Templates/v3/Projects/CustomActionVB/CustomAction.vbproj index 4042be4..3bbce19 100644 --- a/src/Templates/v3/Projects/CustomActionVB/CustomAction.vbproj +++ b/src/Templates/v3/Projects/CustomActionVB/CustomAction.vbproj @@ -61,6 +61,6 @@ $endif$ - + diff --git a/src/Templates/v3/Projects/CustomActionVB/CustomActionVB.vstemplate b/src/Templates/v3/Projects/CustomActionVB/CustomActionVB.vstemplate index 7ae3ea2..e95031e 100644 --- a/src/Templates/v3/Projects/CustomActionVB/CustomActionVB.vstemplate +++ b/src/Templates/v3/Projects/CustomActionVB/CustomActionVB.vstemplate @@ -1,8 +1,8 @@ - VB Custom Action Project - A project for creating an MSI custom action + VB Custom Action Project for WiX v3 + A project for creating an MSI custom action using WiX Toolset v3 WiX Microsoft.Deployment.WindowsInstaller.CustomActionVB diff --git a/src/Templates/v3/Projects/WixBundleProject/BundleProject.wixproj b/src/Templates/v3/Projects/WixBundleProject/BundleProject.wixproj index 1272b4c..a6bef7f 100644 --- a/src/Templates/v3/Projects/WixBundleProject/BundleProject.wixproj +++ b/src/Templates/v3/Projects/WixBundleProject/BundleProject.wixproj @@ -30,7 +30,7 @@ - + + + + $(MSBuildProgramFiles32)\MSBuild\Microsoft\WiX\v3.x\ + + + + + + + diff --git a/src/Votive2017/redirects/v3/wix.targets b/src/Votive2017/redirects/v3/wix.targets index 9feff92..2f5f6dc 100644 --- a/src/Votive2017/redirects/v3/wix.targets +++ b/src/Votive2017/redirects/v3/wix.targets @@ -6,7 +6,7 @@ - - + + diff --git a/src/Votive2017/redirects/v4/wix.ca.targets b/src/Votive2017/redirects/v4/wix.ca.targets index 3556663..e4a25eb 100644 --- a/src/Votive2017/redirects/v4/wix.ca.targets +++ b/src/Votive2017/redirects/v4/wix.ca.targets @@ -6,7 +6,7 @@ - + diff --git a/src/Votive2017/redirects/v4/wix.nativeca.targets b/src/Votive2017/redirects/v4/wix.nativeca.targets new file mode 100644 index 0000000..f004257 --- /dev/null +++ b/src/Votive2017/redirects/v4/wix.nativeca.targets @@ -0,0 +1,12 @@ + + + + + $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\WiX Toolset\v4', 'InstallFolder', null, RegistryView.Registry32)) + + + + + + + diff --git a/src/Votive2017/redirects/v4/wix.targets b/src/Votive2017/redirects/v4/wix.targets index 365028e..f460f68 100644 --- a/src/Votive2017/redirects/v4/wix.targets +++ b/src/Votive2017/redirects/v4/wix.targets @@ -6,7 +6,7 @@ - +