forked from rustdesk/rustdesk
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #14 from rustdesk/master
sync
- Loading branch information
Showing
25 changed files
with
357 additions
and
214 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
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 |
Oops, something went wrong.