1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-23 23:21:08 +01:00

Changed ep_setup command line and default behavior

This commit is contained in:
Valentin Radu 2021-11-19 18:57:32 +02:00
parent cd8cbecfa0
commit 112f4bf92d
5 changed files with 27 additions and 34 deletions

View File

@ -17,6 +17,7 @@ Tested on build 22000.318 and 22000.346 (currently in Windows Insider beta and r
* `ep-setup /extract "C:\test with space"` - extracts to `C:\test with space` directory
* Taskbar toolbar layouts are preserved when switching between Windows 10 and Windows 11 taskbars and in general (these will be reset when installing this update but should be subsequently remembered) (#395) (.2)
* Implemented option to toggle taskbar auto-hide when double clicking the main taskbar (#389) (.3)
* Running `ep-setup.exe` again while EP is already installed will now update the program to the latest version. To uninstall, as the previous behavior did, run `ep_setup.exe /uninstall` (.4)
#### Feature enhancements

View File

@ -42,13 +42,13 @@ Items marked with "bug" that are still "Open" represent known issues. Active wor
## Uninstalling
* Run `ep_setup.exe` again.
* Via "Programs and Features" in Control Panel, or "Apps and features" in the Settings app.
* Use "Programs and Features" in Control Panel, or "Apps and features" in the Settings app.
* Run `ep_setup.exe /uninstall`.
## Updating
* The program features built-in updates: go to "Properties" - "Updates" to configure, check for and install the latest updates.
* Download latest setup file and run `ep_setup.exe /update_silent`
* Download the latest version's setup file and simply run it
## More information

View File

@ -301,8 +301,6 @@ int WINAPI wWinMain(
&argc
);
bIsUpdate = (argc >= 1 && !_wcsicmp(wargv[0], L"/update_silent"));
WCHAR wszPath[MAX_PATH];
ZeroMemory(wszPath, MAX_PATH * sizeof(WCHAR));
@ -338,6 +336,21 @@ int WINAPI wWinMain(
return 0;
}
bInstall = !(argc >= 1 && (!_wcsicmp(wargv[0], L"/uninstall") || !_wcsicmp(wargv[0], L"/uninstall_silent")));
bIsUpdate = (argc >= 1 && !_wcsicmp(wargv[0], L"/update_silent"));
if (!bInstall && !_wcsicmp(wargv[0], L"/uninstall"))
{
if (MessageBoxW(
NULL,
L"Are you sure you want to remove " _T(PRODUCT_NAME) L" from your computer?",
_T(PRODUCT_NAME),
MB_YESNO | MB_DEFBUTTON2 | MB_ICONQUESTION
) == IDNO)
{
exit(0);
}
}
if (!IsAppRunningAsAdminMode())
{
WCHAR wszPath[MAX_PATH];
@ -349,7 +362,7 @@ int WINAPI wWinMain(
sei.cbSize = sizeof(sei);
sei.lpVerb = L"runas";
sei.lpFile = wszPath;
sei.lpParameters = lpCmdLine;
sei.lpParameters = !bInstall ? L"/uninstall_silent" : lpCmdLine;
sei.hwnd = NULL;
sei.nShow = SW_NORMAL;
if (!ShellExecuteExW(&sei))
@ -363,28 +376,6 @@ int WINAPI wWinMain(
}
}
if (bOk)
{
bOk = GetWindowsDirectoryW(wszPath, MAX_PATH);
}
if (bOk)
{
wcscat_s(wszPath, MAX_PATH, L"\\dxgi.dll");
bInstall = !FileExistsW(wszPath) || bIsUpdate;
}
if (!bInstall)
{
if (MessageBoxW(
NULL,
L"Are you sure you want to remove " _T(PRODUCT_NAME) L" from your computer?",
_T(PRODUCT_NAME),
MB_YESNO | MB_DEFBUTTON2 | MB_ICONQUESTION
) == IDNO)
{
exit(0);
}
}
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszPath);
wcscat_s(wszPath, MAX_PATH, _T(APP_RELATIVE_PATH));
bOk = CreateDirectoryW(wszPath, NULL);
@ -566,8 +557,9 @@ int WINAPI wWinMain(
}
if (bOk)
{
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszPath);
wcscat_s(wszPath, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(SETUP_UTILITY_NAME));
wszPath[0] = L'"';
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszPath + 1);
wcscat_s(wszPath, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(SETUP_UTILITY_NAME) L"\" /uninstall");
bOk = SetupUninstallEntry(bInstall, wszPath);
}

View File

@ -57,7 +57,7 @@ int WINAPI wWinMain(
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = L"runas";
ShExecInfo.lpFile = wszPath;
ShExecInfo.lpParameters = L"/update_silent";
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;

View File

@ -1,7 +1,7 @@
#define VER_MAJOR 22000
#define VER_MINOR 318
#define VER_BUILD_HI 38
#define VER_BUILD_LO 3
#define VER_BUILD_LO 4
#define VER_FLAGS VS_FF_PRERELEASE
@ -12,5 +12,5 @@
#define VER_STR(arg) #arg
// The String form of the version numbers
#define VER_FILE_STRING VALUE "FileVersion", "22000.318.38.3"
#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.318.38.3"
#define VER_FILE_STRING VALUE "FileVersion", "22000.318.38.4"
#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.318.38.4"