mirror of
https://github.com/ckaczor/WixBalExtensionExt.git
synced 2026-01-14 01:25:43 -05:00
Initial commit
This commit is contained in:
29
bafunctions/IBootstrapperBAFunction.h
Normal file
29
bafunctions/IBootstrapperBAFunction.h
Normal file
@@ -0,0 +1,29 @@
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="IBootstrapperBAFunction.h" company="Outercurve Foundation">
|
||||
// Copyright (c) 2004, Outercurve Foundation.
|
||||
// This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
// The license and further copyright text can be found in the file
|
||||
// LICENSE.TXT at the root directory of the distribution.
|
||||
// </copyright>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "IBootstrapperEngine.h"
|
||||
|
||||
interface IBootstrapperBAFunction
|
||||
{
|
||||
STDMETHOD(OnDetect)() = 0;
|
||||
STDMETHOD(OnDetectComplete)() = 0;
|
||||
STDMETHOD(OnPlan)() = 0;
|
||||
STDMETHOD(OnPlanComplete)() = 0;
|
||||
};
|
||||
|
||||
extern "C" typedef HRESULT (WINAPI *PFN_BOOTSTRAPPER_BA_FUNCTION_CREATE)(
|
||||
__in IBootstrapperEngine* pEngine,
|
||||
__in HMODULE hModule,
|
||||
__out IBootstrapperBAFunction** ppBAFunction
|
||||
);
|
||||
|
||||
72
bafunctions/Version.proj
Normal file
72
bafunctions/Version.proj
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="WriteVersionFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<MajorBuildNumber>1</MajorBuildNumber>
|
||||
<MinorBuildNumber>0</MinorBuildNumber>
|
||||
|
||||
<CppVersionFile>.\bafunctionsver.h</CppVersionFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Base>$([System.DateTime]::new(2000, 1, 1))</Base>
|
||||
<BuildNumber>$([System.Convert]::ToInt32($([System.DateTime]::Now.ToUniversalTime().Subtract($(Base)).TotalDays)))</BuildNumber>
|
||||
<BuildRevision>$([System.Convert]::ToInt32($([MSBuild]::Divide($([System.Convert]::ToInt32($([System.DateTime]::Now.ToUniversalTime().TimeOfDay.TotalSeconds))), 2))))</BuildRevision>
|
||||
|
||||
<FullBuildVersionString>$(MajorBuildNumber).$(MinorBuildNumber).$(BuildNumber).$(BuildRevision)</FullBuildVersionString>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
================================================================================================
|
||||
VersionPrint
|
||||
|
||||
Displays the versions of this build.
|
||||
================================================================================================
|
||||
-->
|
||||
<Target Name="VersionPrint">
|
||||
<Message Text="FullBuildVersionString = $(FullBuildVersionString)" />
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
================================================================================================
|
||||
WriteCppVersionFile
|
||||
|
||||
Creates the wixver.h version file for C++ code.
|
||||
================================================================================================
|
||||
-->
|
||||
<Target Name="WriteCppVersionFile"
|
||||
Returns="$(CppVersionFile)">
|
||||
<ItemGroup>
|
||||
<CppVersionLines Include="
|
||||
// <auto-generated/>
|
||||
#ifndef _VERSION_FILE_H_
|
||||
#define _VERSION_FILE_H_
|
||||
|
||||
#define szVerMajorMinor "$(MajorBuildNumber).$(MinorBuildNumber)"
|
||||
#define szVerMajorMinorBuildRev "$(FullBuildVersionString)"
|
||||
#define rmj $(MajorBuildNumber)
|
||||
#define rmm $(MinorBuildNumber)
|
||||
#define rbd $(BuildNumber)
|
||||
#define rev $(BuildRevision)
|
||||
|
||||
#endif
|
||||
"/>
|
||||
</ItemGroup>
|
||||
|
||||
<WriteLinesToFile Overwrite="true"
|
||||
File="$(CppVersionFile)"
|
||||
Lines="@(CppVersionLines)" />
|
||||
<ItemGroup>
|
||||
<FileWrites Include="$(CppVersionFile)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
================================================================================================
|
||||
WriteVersionFiles
|
||||
|
||||
Creates the version files.
|
||||
================================================================================================
|
||||
-->
|
||||
<Target Name="WriteVersionFiles" DependsOnTargets="VersionPrint;WriteCppVersionFile" />
|
||||
|
||||
</Project>
|
||||
278
bafunctions/WixBootstrapperBAFunction.cpp
Normal file
278
bafunctions/WixBootstrapperBAFunction.cpp
Normal file
@@ -0,0 +1,278 @@
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="WixBootstrapperBAFunction.cpp" company="Outercurve Foundation">
|
||||
// Copyright (c) 2004, Outercurve Foundation.
|
||||
// This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
// The license and further copyright text can be found in the file
|
||||
// LICENSE.TXT at the root directory of the distribution.
|
||||
// </copyright>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
class CWixBootstrapperBAFunction : IBootstrapperBAFunction
|
||||
{
|
||||
public:
|
||||
STDMETHODIMP OnDetect()
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
HKEY hkKey = NULL;
|
||||
LPWSTR sczValue = NULL;
|
||||
LPWSTR sczFormatedValue = NULL;
|
||||
|
||||
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Running detect BA function");
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// Example of BA function failure
|
||||
//hr = E_NOTIMPL;
|
||||
//BalExitOnFailure(hr, "Test failure.");
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// Example of setting a variables
|
||||
hr = m_pEngine->SetVariableString(L"Variable1", L"String value");
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
hr = m_pEngine->SetVariableNumeric(L"Variable2", 1234);
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// Example of reading burn variable.
|
||||
BalGetStringVariable(L"WixBundleName", &sczValue);
|
||||
BalExitOnFailure(hr, "Failed to get variable.");
|
||||
|
||||
hr = m_pEngine->SetVariableString(L"Variable4", sczValue);
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
ReleaseNullStr(sczValue); // Release string so it can be re-used
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// Examples of reading burn variable and formatting it.
|
||||
BalGetStringVariable(L"InstallFolder", &sczValue);
|
||||
BalExitOnFailure(hr, "Failed to get variable.");
|
||||
|
||||
hr = m_pEngine->SetVariableString(L"Variable5", sczValue);
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
|
||||
BalFormatString(sczValue, &sczFormatedValue);
|
||||
BalExitOnFailure(hr, "Failed to format variable.");
|
||||
|
||||
hr = m_pEngine->SetVariableString(L"Variable6", sczFormatedValue);
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
ReleaseNullStr(sczValue); // Release string so it can be re-used
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
BalFormatString(L"WixBundleVersion=[WixBundleVersion]", &sczValue);
|
||||
BalExitOnFailure(hr, "Failed to format variable.");
|
||||
|
||||
hr = m_pEngine->SetVariableString(L"Variable7", sczValue);
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
ReleaseNullStr(sczValue); // Release string so it can be re-used
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// Example of reading 64 bit registry and setting the InstallFolder variable to the value read.
|
||||
hr = RegOpen(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v3.5", KEY_READ | KEY_WOW64_64KEY, &hkKey);
|
||||
BalExitOnFailure(hr, "Failed to open registry key.");
|
||||
|
||||
hr = RegReadString(hkKey, L"InstallPath", &sczValue);
|
||||
BalExitOnFailure(hr, "Failed to read registry value.");
|
||||
|
||||
// Example of function call
|
||||
PathBackslashTerminate(&sczValue);
|
||||
|
||||
hr = m_pEngine->SetVariableString(L"InstallFolder", sczValue);
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
ReleaseNullStr(sczValue); // Release string so it can be re-used
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
hr = PathRelativeToModule(&sczValue, NULL, m_hModule);
|
||||
hr = m_pEngine->SetVariableString(L"ModulePath", sczValue);
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
ReleaseNullStr(sczValue); // Release string so it can be re-used
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
hr = GetFileVersion();
|
||||
BalExitOnFailure(hr, "Failed to get version.");
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// Delay start to show splashscreen handling
|
||||
Delay();
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
LExit:
|
||||
ReleaseRegKey(hkKey);
|
||||
ReleaseStr(sczValue);
|
||||
ReleaseStr(sczFormatedValue);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP OnDetectComplete() { return S_OK; }
|
||||
|
||||
|
||||
/*
|
||||
STDMETHODIMP OnDetectComplete()
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Running detect complete BA function");
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// YOUR CODE GOES HERE
|
||||
BalExitOnFailure(hr, "Change this message to represent real error handling.");
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
LExit:
|
||||
return hr;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
STDMETHODIMP OnPlan()
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Running plan BA function");
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// Example of converting 4 radio button values in to 1
|
||||
LONGLONG llValue = 0;
|
||||
if (SUCCEEDED(BalGetNumericVariable(L"RadioButton1", &llValue)) && llValue)
|
||||
{
|
||||
m_pEngine->SetVariableNumeric(L"RadioButton", 1);
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
}
|
||||
else if (SUCCEEDED(BalGetNumericVariable(L"RadioButton2", &llValue)) && llValue)
|
||||
{
|
||||
m_pEngine->SetVariableNumeric(L"RadioButton", 2);
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
}
|
||||
else if (SUCCEEDED(BalGetNumericVariable(L"RadioButton3", &llValue)) && llValue)
|
||||
{
|
||||
m_pEngine->SetVariableNumeric(L"RadioButton", 3);
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
}
|
||||
else if (SUCCEEDED(BalGetNumericVariable(L"RadioButton4", &llValue)) && llValue)
|
||||
{
|
||||
m_pEngine->SetVariableNumeric(L"RadioButton", 4);
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pEngine->SetVariableNumeric(L"RadioButton", 0);
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
LExit:
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP OnPlanComplete()
|
||||
{
|
||||
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Running plan complete BA function");
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// Example of function call to get the file version of this bundle
|
||||
//---------------------------------------------------------------------------------------------
|
||||
HRESULT GetFileVersion()
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
LPWSTR sczValue = NULL;
|
||||
ULARGE_INTEGER uliVersion = { };
|
||||
|
||||
BalFormatString(L"[WixBundleOriginalSource]", &sczValue);
|
||||
BalExitOnFailure(hr, "Failed to format variable.");
|
||||
|
||||
FileVersion(sczValue, &uliVersion.HighPart, &uliVersion.LowPart);
|
||||
BalExitOnFailure(hr, "Failed to get file version.");
|
||||
|
||||
hr = m_pEngine->SetVariableVersion(L"FileVersion", uliVersion.QuadPart);
|
||||
BalExitOnFailure(hr, "Failed to set variable.");
|
||||
|
||||
LExit:
|
||||
ReleaseStr(sczValue);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT Delay()
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
LONGLONG llDelay = 0;
|
||||
|
||||
BalGetNumericVariable(L"DelayStart", &llDelay);
|
||||
if (llDelay)
|
||||
{
|
||||
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Delay for %dms", (DWORD)llDelay);
|
||||
::Sleep((DWORD)llDelay);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
HMODULE m_hModule;
|
||||
IBootstrapperEngine* m_pEngine;
|
||||
|
||||
|
||||
public:
|
||||
//
|
||||
// Constructor - initialize member variables.
|
||||
//
|
||||
CWixBootstrapperBAFunction(
|
||||
__in IBootstrapperEngine* pEngine,
|
||||
__in HMODULE hModule
|
||||
)
|
||||
{
|
||||
m_hModule = hModule;
|
||||
m_pEngine = pEngine;
|
||||
}
|
||||
|
||||
//
|
||||
// Destructor - release member variables.
|
||||
//
|
||||
~CWixBootstrapperBAFunction()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
extern "C" HRESULT WINAPI CreateBootstrapperBAFunction(
|
||||
__in IBootstrapperEngine* pEngine,
|
||||
__in HMODULE hModule,
|
||||
__out CWixBootstrapperBAFunction** ppBAFunction
|
||||
)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
CWixBootstrapperBAFunction* pBAFunction = NULL;
|
||||
|
||||
// This is required to enable logging functions
|
||||
BalInitialize(pEngine);
|
||||
|
||||
pBAFunction = new CWixBootstrapperBAFunction(pEngine, hModule);
|
||||
ExitOnNull(pBAFunction, hr, E_OUTOFMEMORY, "Failed to create new bootstrapper BA function object.");
|
||||
|
||||
*ppBAFunction = pBAFunction;
|
||||
pBAFunction = NULL;
|
||||
|
||||
LExit:
|
||||
delete pBAFunction;
|
||||
return hr;
|
||||
}
|
||||
37
bafunctions/bafunctions.cpp
Normal file
37
bafunctions/bafunctions.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="bafunctions.cpp" company="Outercurve Foundation">
|
||||
// Copyright (c) 2004, Outercurve Foundation.
|
||||
// This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
// The license and further copyright text can be found in the file
|
||||
// LICENSE.TXT at the root directory of the distribution.
|
||||
// </copyright>
|
||||
//
|
||||
// <summary>
|
||||
// Entry point for bootstrapper BA function DLL.
|
||||
// </summary>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
static HINSTANCE vhInstance = NULL;
|
||||
|
||||
extern "C" BOOL WINAPI DllMain(
|
||||
IN HINSTANCE hInstance,
|
||||
IN DWORD dwReason,
|
||||
IN LPVOID /* pvReserved */
|
||||
)
|
||||
{
|
||||
switch(dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
::DisableThreadLibraryCalls(hInstance);
|
||||
vhInstance = hInstance;
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
vhInstance = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
16
bafunctions/bafunctions.def
Normal file
16
bafunctions/bafunctions.def
Normal file
@@ -0,0 +1,16 @@
|
||||
;-------------------------------------------------------------------------------------------------
|
||||
; <copyright file="bafunctions.def" company="Outercurve Foundation">
|
||||
; Copyright (c) 2004, Outercurve Foundation.
|
||||
; This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
; The license and further copyright text can be found in the file
|
||||
; LICENSE.TXT at the root directory of the distribution.
|
||||
; </copyright>
|
||||
;
|
||||
; <summary>
|
||||
; Bootstrapper Application function DLL entry points.
|
||||
; </summary>
|
||||
;-------------------------------------------------------------------------------------------------
|
||||
|
||||
EXPORTS
|
||||
CreateBootstrapperBAFunction
|
||||
|
||||
129
bafunctions/bafunctions.rc
Normal file
129
bafunctions/bafunctions.rc
Normal file
@@ -0,0 +1,129 @@
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="bafunctions.rc" company="Outercurve Foundation">
|
||||
// Copyright (c) 2004, Outercurve Foundation.
|
||||
// This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
// The license and further copyright text can be found in the file
|
||||
// LICENSE.TXT at the root directory of the distribution.
|
||||
// </copyright>
|
||||
//
|
||||
// <summary>
|
||||
// WiX Extendend Bootstrapper BA function resource file.
|
||||
// </summary>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
#include <winver.h>
|
||||
#include <windows.h>
|
||||
#include "bafunctionsver.h"
|
||||
|
||||
#define VER_APP
|
||||
#define VER_ORIGINAL_FILENAME "bafunctions.dll"
|
||||
#define VER_INTERNAL_NAME "bafunctions"
|
||||
#define VER_PRODUCT_NAME "WiX Bootstrapper functions"
|
||||
#define VER_FILE_DESCRIPTION "WiX Bootstrapper functions"
|
||||
|
||||
#ifdef DEBUG
|
||||
#define VER_DEBUG VS_FF_DEBUG
|
||||
#define VER_PRIVATE_BUILD VS_FF_PRIVATEBUILD
|
||||
#define VER_PRE_RELEASE (VS_FF_PRERELEASE | VS_FF_SPECIALBUILD)
|
||||
#else
|
||||
#define VER_DEBUG 0
|
||||
#define VER_PRIVATE_BUILD 0
|
||||
#define VER_PRE_RELEASE 0
|
||||
#endif
|
||||
|
||||
#if defined(VER_APP)
|
||||
#define VER_FILE_TYPE VFT_APP
|
||||
#elif defined(VER_DLL)
|
||||
#define VER_FILE_TYPE VFT_DLL
|
||||
#elif defined(VER_TYPELIB)
|
||||
#define VER_FILE_TYPE VFT_UNKNOWN
|
||||
#else
|
||||
#define VER_FILE_TYPE VFT_UNKNOWN
|
||||
#endif
|
||||
|
||||
#if defined(VER_LANG_NEUTRAL)
|
||||
#ifndef VER_LANG
|
||||
#define VER_LANG 0x0000
|
||||
#endif
|
||||
#ifndef VER_CP
|
||||
#define VER_CP 0x04E4
|
||||
#endif
|
||||
#ifndef VER_BLOCK
|
||||
#define VER_BLOCK "000004E4"
|
||||
#endif
|
||||
#else
|
||||
#ifndef VER_LANG
|
||||
#define VER_LANG 0x0409
|
||||
#endif
|
||||
#ifndef VER_CP
|
||||
#define VER_CP 0x04E4
|
||||
#endif
|
||||
#ifndef VER_BLOCK
|
||||
#define VER_BLOCK "040904E4"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define VER_FILE_VERSION rmj, rmm, rbd, rev
|
||||
#define VER_PRODUCT_VERSION rmj, rmm, rbd, rev
|
||||
#define VER_FILE_VERSION_STRING szVerMajorMinorBuildRev
|
||||
#define VER_PRODUCT_VERSION_STRING VER_FILE_VERSION_STRING
|
||||
#define VER_FILE_FLAGS_MASK VS_FFI_FILEFLAGSMASK
|
||||
#define VER_FILE_FLAGS (VER_DEBUG | VER_PRIVATE_BUILD | VER_PRE_RELEASE)
|
||||
|
||||
#define VER_FILE_OS VOS__WINDOWS32
|
||||
|
||||
#define VER_COMPANY_NAME "Outercurve Foundation"
|
||||
#ifndef VER_PRODUCT_NAME
|
||||
#define VER_PRODUCT_NAME "Windows Installer XML (WiX)"
|
||||
#endif
|
||||
#ifndef VER_FILE_DESCRIPTION
|
||||
#define VER_FILE_DESCRIPTION "Windows Installer XML (WiX) component"
|
||||
#endif
|
||||
|
||||
#if defined(VER_LEGAL_COPYRIGHT)
|
||||
#error
|
||||
#endif
|
||||
#define VER_LEGAL_COPYRIGHT "Copyright (c) Outercurve Foundation.\240 All rights reserved."
|
||||
|
||||
#if !defined(VER_FILE_SUBTYPE)
|
||||
#define VER_FILE_SUBTYPE 0
|
||||
#endif
|
||||
|
||||
#ifdef RC_INVOKED
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION VER_FILE_VERSION
|
||||
PRODUCTVERSION VER_PRODUCT_VERSION
|
||||
FILEFLAGSMASK VER_FILE_FLAGS_MASK
|
||||
FILEFLAGS VER_FILE_FLAGS
|
||||
FILEOS VER_FILE_OS
|
||||
FILETYPE VER_FILE_TYPE
|
||||
FILESUBTYPE VER_FILE_SUBTYPE
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK VER_BLOCK
|
||||
BEGIN
|
||||
VALUE "CompanyName", VER_COMPANY_NAME
|
||||
VALUE "FileDescription", VER_FILE_DESCRIPTION
|
||||
VALUE "FileVersion", VER_FILE_VERSION_STRING
|
||||
VALUE "InternalName", VER_INTERNAL_NAME
|
||||
|
||||
VALUE "LegalCopyright", VER_LEGAL_COPYRIGHT
|
||||
|
||||
VALUE "OriginalFilename", VER_ORIGINAL_FILENAME
|
||||
VALUE "ProductName", VER_PRODUCT_NAME
|
||||
VALUE "ProductVersion", VER_FILE_VERSION_STRING
|
||||
#if defined(DEBUG)
|
||||
VALUE "WiX Common Resource Format", "Debug Only"
|
||||
#endif
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", VER_LANG, VER_CP
|
||||
END
|
||||
END
|
||||
|
||||
#endif
|
||||
137
bafunctions/bafunctions.vcxproj
Normal file
137
bafunctions/bafunctions.vcxproj
Normal file
@@ -0,0 +1,137 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<copyright file="bafunctions.vcxproj" company="Outercurve Foundation">
|
||||
Copyright (c) 2004, Outercurve Foundation.
|
||||
This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
The license and further copyright text can be found in the file
|
||||
LICENSE.TXT at the root directory of the distribution.
|
||||
</copyright>
|
||||
-->
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" 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>{EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}</ProjectGuid>
|
||||
<RootNamespace>BaFunctions</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<ProjectName>bafunctions</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</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>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</GenerateManifest>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ExtraDefinitions>
|
||||
</ExtraDefinitions>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(WiX)SDK\VS2010\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;DEBUG;%(PreprocessorDefinitions);$(ExtraDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>dutil.lib;balutil.lib;comctl32.lib;gdiplus.lib;shlwapi.lib;wininet.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(WiX)SDK\VS2010\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<ModuleDefinitionFile>bafunctions.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(WiX)SDK\VS2010\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);$(ExtraDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>dutil.lib;balutil.lib;comctl32.lib;gdiplus.lib;shlwapi.lib;wininet.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(WiX)SDK\VS2010\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<ModuleDefinitionFile>bafunctions.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="WixBootstrapperBAFunction.cpp" />
|
||||
<ClCompile Include="bafunctions.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="bafunctions.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="bafunctions.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="precomp.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="IBootstrapperBAFunction.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
46
bafunctions/bafunctions.vcxproj.filters
Normal file
46
bafunctions/bafunctions.vcxproj.filters
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="bafunctions.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WixBootstrapperBAFunction.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="bafunctions.def">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="precomp.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="IBootstrapperBAFunction.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="bafunctions.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
12
bafunctions/bafunctionsver.h
Normal file
12
bafunctions/bafunctionsver.h
Normal file
@@ -0,0 +1,12 @@
|
||||
// <auto-generated/>
|
||||
#ifndef _VERSION_FILE_H_
|
||||
#define _VERSION_FILE_H_
|
||||
|
||||
#define szVerMajorMinor "1.0"
|
||||
#define szVerMajorMinorBuildRev "1.0.5260.23891"
|
||||
#define rmj 1
|
||||
#define rmm 0
|
||||
#define rbd 5260
|
||||
#define rev 23891
|
||||
|
||||
#endif
|
||||
25
bafunctions/build.bat
Normal file
25
bafunctions/build.bat
Normal file
@@ -0,0 +1,25 @@
|
||||
@echo off
|
||||
|
||||
echo Configuring environment...
|
||||
set MSBUILD="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe"
|
||||
echo.
|
||||
|
||||
set outdir=%~dp0build
|
||||
|
||||
%MSBUILD% Version.proj
|
||||
%MSBUILD% bafunctions.vcxproj /t:Rebuild /p:Configuration=Release,Platform=Win32 /p:RunCodeAnalysis=false /p:DefineConstants="TRACE" /p:OutDir="%outdir%\\" /l:FileLogger,Microsoft.Build.Engine;logfile=build.log
|
||||
if %errorlevel% neq 0 (
|
||||
echo Build failed
|
||||
pause
|
||||
goto :EOF
|
||||
)
|
||||
|
||||
copy build\bafunctions.dll ..\Examples /y
|
||||
|
||||
echo.
|
||||
|
||||
goto :EOF
|
||||
|
||||
REM *****************************************************************
|
||||
REM End of Main
|
||||
REM *****************************************************************
|
||||
52
bafunctions/precomp.h
Normal file
52
bafunctions/precomp.h
Normal file
@@ -0,0 +1,52 @@
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="precomp.h" company="Outercurve Foundation">
|
||||
// Copyright (c) 2004, Outercurve Foundation.
|
||||
// This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
// The license and further copyright text can be found in the file
|
||||
// LICENSE.TXT at the root directory of the distribution.
|
||||
// </copyright>
|
||||
//
|
||||
// <summary>
|
||||
// Precompiled header for standard bootstrapper application.
|
||||
// </summary>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
#include <gdiplus.h>
|
||||
#include <msiquery.h>
|
||||
#include <objbase.h>
|
||||
#include <shlobj.h>
|
||||
#include <shlwapi.h>
|
||||
#include <stdlib.h>
|
||||
#include <strsafe.h>
|
||||
|
||||
// Standard WiX header files, include as required
|
||||
#include "dutil.h"
|
||||
//#include "memutil.h"
|
||||
//#include "dictutil.h"
|
||||
//#include "dirutil.h"
|
||||
#include "fileutil.h"
|
||||
//#include "locutil.h"
|
||||
//#include "logutil.h"
|
||||
#include "pathutil.h"
|
||||
//#include "resrutil.h"
|
||||
//#include "shelutil.h"
|
||||
#include "strutil.h"
|
||||
//#include "thmutil.h"
|
||||
//#include "uriutil.h"
|
||||
//#include "xmlutil.h"
|
||||
#include "regutil.h"
|
||||
|
||||
//#include "IBootstrapperEngine.h"
|
||||
//#include "IBootstrapperApplication.h"
|
||||
|
||||
#include "BalBaseBootstrapperApplication.h"
|
||||
//#include "balinfo.h"
|
||||
//#include "balcondition.h"
|
||||
#include "balutil.h"
|
||||
|
||||
#include "IBootstrapperBAFunction.h"
|
||||
|
||||
25
bafunctions/resource.h
Normal file
25
bafunctions/resource.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="resource.h" company="Outercurve Foundation">
|
||||
// Copyright (c) 2004, Outercurve Foundation.
|
||||
// This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
// The license and further copyright text can be found in the file
|
||||
// LICENSE.TXT at the root directory of the distribution.
|
||||
// </copyright>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
//
|
||||
#define IDC_STATIC -1
|
||||
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1003
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user