Skip to content

Commit

Permalink
Refact. Msi, remove unused code (rustdesk#7685)
Browse files Browse the repository at this point in the history
Signed-off-by: fufesou <[email protected]>
  • Loading branch information
fufesou authored Apr 11, 2024
1 parent 6402075 commit aa002c5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 24 deletions.
22 changes: 1 addition & 21 deletions res/msi/CustomActions/CustomActions.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// CustomAction.cpp : Defines the entry point for the custom action.
#include "pch.h"

#include <stdlib.h>
#include <strutil.h>
#include <shellapi.h>
#include <tlhelp32.h>
Expand Down Expand Up @@ -70,26 +70,6 @@ UINT __stdcall RemoveInstallFolder(
return WcaFinalize(er);
}

#include "../../../src/platform/windows_delete_test_cert.cc";
UINT __stdcall DeleteTestCerts(
__in MSIHANDLE hInstall)
{
HRESULT hr = S_OK;
DWORD er = ERROR_SUCCESS;

hr = WcaInitialize(hInstall, "DeleteTestCerts");
ExitOnFailure(hr, "Failed to initialize");

WcaLog(LOGMSG_STANDARD, "Initialized.");

DeleteRustDeskTestCertsW();
WcaLog(LOGMSG_STANDARD, "DeleteRustDeskTestCertsW finished.");

LExit:
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
return WcaFinalize(er);
}

// https://learn.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntqueryinformationprocess
// **NtQueryInformationProcess** may be altered or unavailable in future versions of Windows.
// Applications should use the alternate functions listed in this topic.
Expand Down
1 change: 0 additions & 1 deletion res/msi/CustomActions/CustomActions.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ LIBRARY "CustomActions"
EXPORTS
CustomActionHello
RemoveInstallFolder
DeleteTestCerts
TerminateProcesses
1 change: 0 additions & 1 deletion res/msi/Package/Components/RustDesk.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

<Custom Action="RemoveInstallFolder.SetParam" After="RemoveFiles"/>
<Custom Action="RemoveInstallFolder" After="RemoveInstallFolder.SetParam"/>
<Custom Action="DeleteTestCerts" After="RemoveFiles"/>
</InstallExecuteSequence>

<!-- Shortcuts -->
Expand Down
1 change: 0 additions & 1 deletion res/msi/Package/Fragments/CustomActions.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

<CustomAction Id="CustomActionHello" DllEntry="CustomActionHello" Impersonate="yes" Execute="immediate" Return="ignore" BinaryRef="Custom_Actions_Dll"/>
<CustomAction Id="RemoveInstallFolder" DllEntry="RemoveInstallFolder" Impersonate="no" Execute="deferred" Return="ignore" BinaryRef="Custom_Actions_Dll"/>
<CustomAction Id="DeleteTestCerts" DllEntry="DeleteTestCerts" Impersonate="no" Execute="deferred" Return="ignore" BinaryRef="Custom_Actions_Dll"/>
<CustomAction Id="TerminateProcesses" DllEntry="TerminateProcesses" Impersonate="yes" Execute="immediate" Return="ignore" BinaryRef="Custom_Actions_Dll"/>
</Fragment>
</Wix>

0 comments on commit aa002c5

Please sign in to comment.