forked from rustdesk/rustdesk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rustdesk:master' into master
- Loading branch information
Showing
23 changed files
with
352 additions
and
192 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,10 @@ | |
|
||
**/bin | ||
**/obj | ||
|
||
x64 | ||
packages | ||
|
||
CustomActions/x64 | ||
CustomActions/*.user | ||
CustomActions/*.filters |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,63 @@ | ||
// CustomAction.cpp : Defines the entry point for the custom action. | ||
#include "pch.h" | ||
#include <shellapi.h> | ||
|
||
UINT __stdcall CustomActionHello( | ||
__in MSIHANDLE hInstall | ||
) | ||
{ | ||
HRESULT hr = S_OK; | ||
DWORD er = ERROR_SUCCESS; | ||
|
||
hr = WcaInitialize(hInstall, "CustomActionHello"); | ||
ExitOnFailure(hr, "Failed to initialize"); | ||
|
||
WcaLog(LOGMSG_STANDARD, "Initialized."); | ||
|
||
// TODO: Add your custom action code here. | ||
WcaLog(LOGMSG_STANDARD, "================= Example CustomAction Hello"); | ||
|
||
LExit: | ||
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; | ||
return WcaFinalize(er); | ||
} | ||
|
||
UINT __stdcall RemoveInstallFolder( | ||
__in MSIHANDLE hInstall | ||
) | ||
{ | ||
HRESULT hr = S_OK; | ||
DWORD er = ERROR_SUCCESS; | ||
|
||
int nResult = 0; | ||
wchar_t szCustomActionData[256] = { 0 }; | ||
DWORD cchCustomActionData = sizeof(szCustomActionData) / sizeof(szCustomActionData[0]); | ||
|
||
hr = WcaInitialize(hInstall, "RemoveInstallFolder"); | ||
ExitOnFailure(hr, "Failed to initialize"); | ||
|
||
MsiGetPropertyW(hInstall, L"InstallFolder", szCustomActionData, &cchCustomActionData); | ||
|
||
WcaLog(LOGMSG_STANDARD, "================= Remove Install Folder: %ls", szCustomActionData); | ||
|
||
SHFILEOPSTRUCTW fileOp; | ||
ZeroMemory(&fileOp, sizeof(SHFILEOPSTRUCT)); | ||
|
||
fileOp.wFunc = FO_DELETE; | ||
fileOp.pFrom = szCustomActionData; | ||
fileOp.fFlags = FOF_NOCONFIRMATION | FOF_SILENT; | ||
|
||
nResult = SHFileOperationW(&fileOp); | ||
if (nResult == 0) | ||
{ | ||
WcaLog(LOGMSG_STANDARD, "The directory \"%ls\" has been deleted.", szCustomActionData); | ||
} | ||
else | ||
{ | ||
WcaLog(LOGMSG_STANDARD, "The directory \"%ls\" has not been deleted, error code: 0X%02X.", szCustomActionData, nResult); | ||
} | ||
|
||
LExit: | ||
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; | ||
return WcaFinalize(er); | ||
} |
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
LIBRARY "CustomActions" | ||
|
||
EXPORTS | ||
CustomActionHello | ||
RemoveInstallFolder |
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,80 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="..\packages\WixToolset.WcaUtil.4.0.5\build\WixToolset.WcaUtil.props" Condition="Exists('..\packages\WixToolset.WcaUtil.4.0.5\build\WixToolset.WcaUtil.props')" /> | ||
<Import Project="..\packages\WixToolset.DUtil.4.0.5\build\WixToolset.DUtil.props" Condition="Exists('..\packages\WixToolset.DUtil.4.0.5\build\WixToolset.DUtil.props')" /> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Release|x64"> | ||
<Configuration>Release</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<Keyword>Win32Proj</Keyword> | ||
<ProjectGuid>{87e7c13b-ae0e-4048-95cf-4523d510a3cd}</ProjectGuid> | ||
<RootNamespace>CustomActions</RootNamespace> | ||
<PlatformToolset>v143</PlatformToolset> | ||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="ExtensionSettings"> | ||
</ImportGroup> | ||
<ImportGroup Label="Shared"> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>NDEBUG;EXAMPLECADLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>true</ConformanceMode> | ||
<PrecompiledHeader>Use</PrecompiledHeader> | ||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> | ||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> | ||
</ClCompile> | ||
<Link> | ||
<AdditionalDependencies>msi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
<SubSystem>Windows</SubSystem> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
<EnableUAC>false</EnableUAC> | ||
<ModuleDefinitionFile>CustomActions.def</ModuleDefinitionFile> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<ClInclude Include="framework.h" /> | ||
<ClInclude Include="pch.h" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="CustomActions.cpp" /> | ||
<ClCompile Include="dllmain.cpp" /> | ||
<ClCompile Include="pch.cpp"> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> | ||
</ClCompile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="CustomActions.def" /> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets" /> | ||
<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\WixToolset.DUtil.4.0.5\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WixToolset.DUtil.4.0.5\build\WixToolset.DUtil.props'))" /> | ||
<Error Condition="!Exists('..\packages\WixToolset.WcaUtil.4.0.5\build\WixToolset.WcaUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WixToolset.WcaUtil.4.0.5\build\WixToolset.WcaUtil.props'))" /> | ||
</Target> | ||
</Project> |
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,26 @@ | ||
// dllmain.cpp : Defines the entry point for the DLL application. | ||
#include "pch.h" | ||
|
||
BOOL APIENTRY DllMain( | ||
__in HMODULE hModule, | ||
__in DWORD ulReasonForCall, | ||
__in LPVOID | ||
) | ||
{ | ||
switch (ulReasonForCall) | ||
{ | ||
case DLL_PROCESS_ATTACH: | ||
WcaGlobalInitialize(hModule); | ||
break; | ||
|
||
case DLL_PROCESS_DETACH: | ||
WcaGlobalFinalize(); | ||
break; | ||
|
||
case DLL_THREAD_ATTACH: | ||
case DLL_THREAD_DETACH: | ||
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,10 @@ | ||
#pragma once | ||
|
||
#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> |
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="WixToolset.DUtil" version="4.0.5" targetFramework="native" /> | ||
<package id="WixToolset.WcaUtil" version="4.0.5" targetFramework="native" /> | ||
</packages> |
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,5 @@ | ||
// pch.cpp: source file corresponding to the pre-compiled header | ||
|
||
#include "pch.h" | ||
|
||
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. |
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,13 @@ | ||
// pch.h: This is a precompiled header file. | ||
// Files listed below are compiled only once, improving build performance for future builds. | ||
// This also affects IntelliSense performance, including code completion and many code browsing features. | ||
// However, files listed here are ALL re-compiled if any one of them is updated between builds. | ||
// Do not add files here that you will be updating frequently as this negates the performance advantage. | ||
|
||
#ifndef PCH_H | ||
#define PCH_H | ||
|
||
// add headers that you want to pre-compile here | ||
#include "framework.h" | ||
|
||
#endif //PCH_H |
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
Oops, something went wrong.