VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-03-17 15:39:50 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-03-17 22:13:52 +0100
commitf397f70fbe8e43eaa502db00a768e76d7ec377a8 (patch)
tree4f916bb1e22512c875d3f4e3e546aef0fb25a00b /src
parentae5867f8b1377bedeffe6a8a44dce6211a0018c8 (diff)
downloadVeraCrypt-f397f70fbe8e43eaa502db00a768e76d7ec377a8.tar.gz
VeraCrypt-f397f70fbe8e43eaa502db00a768e76d7ec377a8.zip
Windows Setup: When clicking uninstall link, launch Windows Add/Remove program instead of uninstall directly in order to avoid being flagged as legacy application by the Windows Program Compatibility Assistant (see number 5 in Microsoft UI Design Standard https://msdn.microsoft.com/en-us/library/ms954377.aspx)
Diffstat (limited to 'src')
-rw-r--r--src/Setup/Setup.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c
index 700045c9..b24b479d 100644
--- a/src/Setup/Setup.c
+++ b/src/Setup/Setup.c
@@ -415,7 +415,7 @@ BOOL SetPrivilege(LPTSTR szPrivilegeName, BOOL bEnable)
}
HRESULT CreateLink (char *lpszPathObj, char *lpszArguments,
- char *lpszPathLink)
+ char *lpszPathLink, const char* iconFile, int iconIndex)
{
HRESULT hres;
IShellLink *psl;
@@ -431,6 +431,10 @@ HRESULT CreateLink (char *lpszPathObj, char *lpszArguments,
description. */
psl->SetPath (lpszPathObj);
psl->SetArguments (lpszArguments);
+ if (iconFile)
+ {
+ psl->SetIconLocation (iconFile, iconIndex);
+ }
// Application ID
if (strstr (lpszPathObj, TC_APP_NAME ".exe"))
@@ -1573,14 +1577,14 @@ BOOL DoShortcutsInstall (HWND hwndDlg, char *szDestDir, BOOL bProgGroup, BOOL bD
StringCbPrintfA (szTmp2, sizeof(szTmp2), "%s%s", szLinkDir, "\\VeraCrypt.lnk");
IconMessage (hwndDlg, szTmp2);
- if (CreateLink (szTmp, "", szTmp2) != S_OK)
+ if (CreateLink (szTmp, "", szTmp2, NULL, -1) != S_OK)
goto error;
StringCbPrintfA (szTmp, sizeof(szTmp), "%s%s", szDir, "VeraCryptExpander.exe");
StringCbPrintfA (szTmp2, sizeof(szTmp2), "%s%s", szLinkDir, "\\VeraCryptExpander.lnk");
IconMessage (hwndDlg, szTmp2);
- if (CreateLink (szTmp, "", szTmp2) != S_OK)
+ if (CreateLink (szTmp, "", szTmp2, NULL, -1) != S_OK)
goto error;
StringCbPrintfA (szTmp2, sizeof(szTmp2), "%s%s", szLinkDir, "\\VeraCrypt Website.url");
@@ -1598,10 +1602,15 @@ BOOL DoShortcutsInstall (HWND hwndDlg, char *szDestDir, BOOL bProgGroup, BOOL bD
StringCbPrintfA (szTmp, sizeof(szTmp), "%s%s", szDir, "VeraCrypt Setup.exe");
StringCbPrintfA (szTmp2, sizeof(szTmp2), "%s%s", szLinkDir, "\\Uninstall VeraCrypt.lnk");
- StringCbCopyA (szTmp3, sizeof(szTmp3), "/u");
+ if (GetSystemDirectoryA (szTmp3, sizeof(szTmp3)))
+ {
+ StringCbCatA (szTmp3, sizeof(szTmp3), "\\control.exe");
+ }
+ else
+ StringCbCopyA(szTmp3, sizeof(szTmp3), "C:\\Windows\\System32\\control.exe");
IconMessage (hwndDlg, szTmp2);
- if (CreateLink (szTmp, szTmp3, szTmp2) != S_OK)
+ if (CreateLink (szTmp3, "appwiz.cpl", szTmp2, szTmp, 0) != S_OK)
goto error;
StringCbPrintfA (szTmp2, sizeof(szTmp2), "%s%s", szLinkDir, "\\VeraCrypt User's Guide.lnk");
@@ -1630,7 +1639,7 @@ BOOL DoShortcutsInstall (HWND hwndDlg, char *szDestDir, BOOL bProgGroup, BOOL bD
IconMessage (hwndDlg, szTmp2);
- if (CreateLink (szTmp, "", szTmp2) != S_OK)
+ if (CreateLink (szTmp, "", szTmp2, NULL, -1) != S_OK)
goto error;
}