diff --git a/_pre-commit.sh b/_pre-commit.sh index 12469c41..15ccb63a 100755 --- a/_pre-commit.sh +++ b/_pre-commit.sh @@ -38,7 +38,9 @@ _EOF sed -i -e "s/@@BUILD@@/$BUILD/g" cmd.sed # Run sed to update the nano version sed -b -i -f cmd.sed src/rufus.rc +sed -b -i -f cmd.sed res/appstore/Package.appxmanifest # NB: we need to run git add else the modified files may be ignored git add src/rufus.rc +git add res/appstore/Package.appxmanifest rm cmd.sed diff --git a/res/appstore/Package.appxmanifest b/res/appstore/Package.appxmanifest index 8302608d..596d122e 100644 --- a/res/appstore/Package.appxmanifest +++ b/res/appstore/Package.appxmanifest @@ -10,7 +10,7 @@ + Version="3.13.1733.0" /> Rufus @@ -19,7 +19,6 @@ - @@ -30,7 +29,7 @@ + EntryPoint="Windows.FullTrustApplication"> - diff --git a/res/appstore/appstore.wapproj b/res/appstore/appstore.wapproj index 6192726b..3cb51f69 100644 --- a/res/appstore/appstore.wapproj +++ b/res/appstore/appstore.wapproj @@ -38,7 +38,7 @@ - echo "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64\signtool" sign /v /sha1 9ce9a71ccab3b38a74781b975f1c228222cf7d3b /fd SHA256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp rufus.exe + "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64\signtool" sign /v /sha1 9ce9a71ccab3b38a74781b975f1c228222cf7d3b /fd SHA256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp rufus.exe $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ diff --git a/rufus.sln b/rufus.sln index 56d051f7..490f65b8 100644 --- a/rufus.sln +++ b/rufus.sln @@ -215,29 +215,13 @@ Global {B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|x86.ActiveCfg = Release|Win32 {B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|x86.Build.0 = Release|Win32 {9440518F-38FE-43D9-9151-A26618E8C978}.Debug|arm.ActiveCfg = Debug|ARM - {9440518F-38FE-43D9-9151-A26618E8C978}.Debug|arm.Build.0 = Debug|ARM - {9440518F-38FE-43D9-9151-A26618E8C978}.Debug|arm.Deploy.0 = Debug|ARM {9440518F-38FE-43D9-9151-A26618E8C978}.Debug|arm64.ActiveCfg = Debug|ARM64 - {9440518F-38FE-43D9-9151-A26618E8C978}.Debug|arm64.Build.0 = Debug|ARM64 - {9440518F-38FE-43D9-9151-A26618E8C978}.Debug|arm64.Deploy.0 = Debug|ARM64 {9440518F-38FE-43D9-9151-A26618E8C978}.Debug|x64.ActiveCfg = Debug|x64 - {9440518F-38FE-43D9-9151-A26618E8C978}.Debug|x64.Build.0 = Debug|x64 - {9440518F-38FE-43D9-9151-A26618E8C978}.Debug|x64.Deploy.0 = Debug|x64 {9440518F-38FE-43D9-9151-A26618E8C978}.Debug|x86.ActiveCfg = Debug|x86 - {9440518F-38FE-43D9-9151-A26618E8C978}.Debug|x86.Build.0 = Debug|x86 - {9440518F-38FE-43D9-9151-A26618E8C978}.Debug|x86.Deploy.0 = Debug|x86 {9440518F-38FE-43D9-9151-A26618E8C978}.Release|arm.ActiveCfg = Release|ARM - {9440518F-38FE-43D9-9151-A26618E8C978}.Release|arm.Build.0 = Release|ARM - {9440518F-38FE-43D9-9151-A26618E8C978}.Release|arm.Deploy.0 = Release|ARM {9440518F-38FE-43D9-9151-A26618E8C978}.Release|arm64.ActiveCfg = Release|ARM64 - {9440518F-38FE-43D9-9151-A26618E8C978}.Release|arm64.Build.0 = Release|ARM64 - {9440518F-38FE-43D9-9151-A26618E8C978}.Release|arm64.Deploy.0 = Release|ARM64 {9440518F-38FE-43D9-9151-A26618E8C978}.Release|x64.ActiveCfg = Release|x64 - {9440518F-38FE-43D9-9151-A26618E8C978}.Release|x64.Build.0 = Release|x64 - {9440518F-38FE-43D9-9151-A26618E8C978}.Release|x64.Deploy.0 = Release|x64 {9440518F-38FE-43D9-9151-A26618E8C978}.Release|x86.ActiveCfg = Release|x86 - {9440518F-38FE-43D9-9151-A26618E8C978}.Release|x86.Build.0 = Release|x86 - {9440518F-38FE-43D9-9151-A26618E8C978}.Release|x86.Deploy.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/rufus.c b/src/rufus.c index 45d21bc8..93e150b9 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -120,7 +120,7 @@ BOOL advanced_mode_device, advanced_mode_format, allow_dual_uefi_bios, detect_fa BOOL use_fake_units, preserve_timestamps = FALSE, fast_zeroing = FALSE, app_changed_size = FALSE; BOOL zero_drive = FALSE, list_non_usb_removable_drives = FALSE, enable_file_indexing, large_drive = FALSE; BOOL write_as_image = FALSE, write_as_esp = FALSE, installed_uefi_ntfs = FALSE, use_vds = FALSE, ignore_boot_marker = FALSE; -BOOL windows_to_go_selected = FALSE; +BOOL windows_to_go_selected = FALSE, appstore_version = FALSE; float fScale = 1.0f; int dialog_showing = 0, selection_default = BT_IMAGE, persistence_unit_selection = -1; int default_fs, fs_type, boot_type, partition_type, target_type; // file system, boot type, partition type, target type @@ -3087,7 +3087,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine int wait_for_mutex = 0; FILE* fd; BOOL attached_console = FALSE, external_loc_file = FALSE, lgp_set = FALSE, automount = TRUE; - BOOL disable_hogger = FALSE, previous_enable_HDDs = FALSE; // , vc = IsRegistryNode(REGKEY_HKCU, vs_reg); + BOOL disable_hogger = FALSE, previous_enable_HDDs = FALSE, vc = IsRegistryNode(REGKEY_HKCU, vs_reg); BOOL alt_pressed = FALSE, alt_command = FALSE; BYTE *loc_data; DWORD loc_size, u, size = sizeof(u); @@ -3101,6 +3101,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine HDC hDC; MSG msg; struct option long_options[] = { + {"appstore", no_argument, NULL, 'a'}, {"extra-devs", no_argument, NULL, 'x'}, {"gui", no_argument, NULL, 'g'}, {"help", no_argument, NULL, 'h'}, @@ -3145,13 +3146,14 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine // We have to process the arguments before we acquire the lock and process the locale PF_INIT(__wgetmainargs, Msvcrt); if (pf__wgetmainargs != NULL) { + BOOL list_params = TRUE; // TODO: Remove this once we've seen more from AppStore pf__wgetmainargs(&argc, &wargv, &wenv, 1, &si); argv = (char**)calloc(argc, sizeof(char*)); if (argv != NULL) { // Non getopt parameter check for (i = 0; i < argc; i++) { argv[i] = wchar_to_utf8(wargv[i]); - // Check for " /W" (wait for mutex release for pre 1.3.3 versions) + // Check for "/W" (wait for mutex release for pre 1.3.3 versions) if (strcmp(argv[i], "/W") == 0) wait_for_mutex = 150; // Try to acquire the mutex for 15 seconds // We need to find if we need to disable the hogger BEFORE we start @@ -3159,6 +3161,14 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine // on the commandline then, which the hogger makes more intuitive. if ((strcmp(argv[i], "-g") == 0) || (strcmp(argv[i], "--gui") == 0)) disable_hogger = TRUE; + // Check for "/InvokerPRAID", which is *STUPIDLY* added by Microsoft + // when starting an app that was installed from the Windows store... + if ((stricmp(argv[i], "/InvokerPRAID") == 0) || (strcmp(argv[i], "-a") == 0) || + (strcmp(argv[i], "--appstore") == 0)) { + uprintf("AppStore version detected"); + appstore_version = TRUE; + goto skip_args_processing; + } } // If our application name contains a 'p' (for "portable") create a 'rufus.ini' // NB: argv[0] is populated in the previous loop @@ -3173,6 +3183,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (!disable_hogger) { // Reattach the console, if we were started from commandline if (AttachConsole(ATTACH_PARENT_PROCESS) != 0) { + uprintf("Enabling console line hogger"); attached_console = TRUE; IGNORE_RETVAL(freopen("CONIN$", "r", stdin)); IGNORE_RETVAL(freopen("CONOUT$", "w", stdout)); @@ -3182,11 +3193,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine } } - while ((opt = getopt_long(argc, argv, "?xghf:i:w:l:", long_options, &option_index)) != EOF) { + while ((opt = getopt_long(argc, argv, "xghf:i:w:l:", long_options, &option_index)) != EOF) { switch (opt) { case 'x': enable_HDDs = TRUE; break; + case 'a': case 'g': // No need to reprocess that option break; @@ -3227,19 +3239,26 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine case 'w': wait_for_mutex = atoi(optarg); break; - case '?': case 'h': - default: -uprintf("Rufus usage selected"); PrintUsage(argv[0]); goto out; + // getopt_long returns '?' for any option it doesn't recognize + default: + list_params = TRUE; + break; } } + if (list_params) { + uprintf("Command line arguments:"); + for (i = 1; i < argc; i++) + uprintf(argv[i]); + } } } else { uprintf("Could not access UTF-16 args"); } -uprintf("Post args processing"); + +skip_args_processing: // Retrieve various app & system directories if (GetCurrentDirectoryU(sizeof(app_dir), app_dir) == 0) { uprintf("Could not get current directory: %s", WindowsErrorString()); @@ -3253,7 +3272,6 @@ uprintf("Post args processing"); uprintf("Could not get temp directory: %s", WindowsErrorString()); static_strcpy(temp_dir, ".\\"); } -uprintf("Post dirs processing"); // Construct Sysnative ourselves as there is no GetSysnativeDirectory() call // By default (64bit app running on 64 bit OS or 32 bit app running on 32 bit OS) // Sysnative and System32 are the same @@ -3272,7 +3290,7 @@ uprintf("Post dirs processing"); // Look for a .ini file in the current app directory static_sprintf(ini_path, "%s\\rufus.ini", app_dir); fd = fopenU(ini_path, ini_flags); // Will create the file if portable mode is requested -// vc |= (safe_strcmp(GetSignatureName(NULL, NULL), cert_name[0]) == 0); + vc |= (safe_strcmp(GetSignatureName(NULL, NULL), cert_name[0]) == 0); if (fd != NULL) { ini_file = ini_path; fclose(fd); @@ -3431,12 +3449,12 @@ relaunch: if (get_loc_data_file(loc_file, selected_locale)) WriteSettingStr(SETTING_LOCALE, selected_locale->txt[0]); - //if (!vc) { - // if (MessageBoxExU(NULL, lmprintf(MSG_296), lmprintf(MSG_295), - // MB_YESNO | MB_ICONWARNING | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid) != IDYES) - // goto out; - // vc = TRUE; - //} + if (!vc) { + if (MessageBoxExU(NULL, lmprintf(MSG_296), lmprintf(MSG_295), + MB_YESNO | MB_ICONWARNING | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid) != IDYES) + goto out; + vc = TRUE; + } /* * Create the main Window diff --git a/src/rufus.rc b/src/rufus.rc index 32255167..0e7a5f2f 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 232, 326 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 3.14.1732" +CAPTION "Rufus 3.14.1733" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -395,8 +395,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,14,1732,0 - PRODUCTVERSION 3,14,1732,0 + FILEVERSION 3,14,1733,0 + PRODUCTVERSION 3,14,1733,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -414,13 +414,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.14.1732" + VALUE "FileVersion", "3.14.1733" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2021 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.13.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.14.1732" + VALUE "ProductVersion", "3.14.1733" END END BLOCK "VarFileInfo"