diff --git a/HISTORY b/HISTORY index 7d99c26..cff9fde 100644 --- a/HISTORY +++ b/HISTORY @@ -1,3 +1,9 @@ +Version 17.1.1 (20??-??-??) +------------------------- +- Exporting user settings now works on Windows XP [https://github.com/clechasseur/pathcopycopy/issues/96] +- When exporting user settings fails, display more information [https://github.com/clechasseur/pathcopycopy/issues/96] + + Version 17.1 (2019-09-29) ------------------------- - Installer and uninstaller are now signed with a valid open-source certificate [https://github.com/clechasseur/pathcopycopy/issues/25] diff --git a/Installer/Setup.iss b/Installer/Setup.iss index e86ac0b..fa15187 100644 --- a/Installer/Setup.iss +++ b/Installer/Setup.iss @@ -26,21 +26,21 @@ #define MyConfiguration "Release" #ifdef PER_USER #define MyAppName "Path Copy Copy (Portable)" - #define MyAppVersion "17.1" - #define MyAppFullVersion "17.1" - #define MyAppVerName "Path Copy Copy (Portable) 17.1" + #define MyAppVersion "17.1.1" + #define MyAppFullVersion "17.1.1" + #define MyAppVerName "Path Copy Copy (Portable) 17.1.1" #else #define MyAppName "Path Copy Copy" - #define MyAppVersion "17.1" - #define MyAppFullVersion "17.1" - #define MyAppVerName "Path Copy Copy 17.1" + #define MyAppVersion "17.1.1" + #define MyAppFullVersion "17.1.1" + #define MyAppVerName "Path Copy Copy 17.1.1" #endif #else #define MyConfiguration "Debug" #define MyAppName "Path Copy Copy DEBUG" - #define MyAppVersion "17.1" - #define MyAppFullVersion "17.1" - #define MyAppVerName "Path Copy Copy DEBUG 17.1" + #define MyAppVersion "17.1.1" + #define MyAppFullVersion "17.1.1" + #define MyAppVerName "Path Copy Copy DEBUG 17.1.1" #endif #define MyAppPublisher "Charles Lechasseur" #define MyAppURL "https://pathcopycopy.github.io/" diff --git a/PathCopyCopy/rsrc/PathCopyCopy.rc b/PathCopyCopy/rsrc/PathCopyCopy.rc index b47ad1a..ef48cb1 100644 --- a/PathCopyCopy/rsrc/PathCopyCopy.rc +++ b/PathCopyCopy/rsrc/PathCopyCopy.rc @@ -57,8 +57,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 17,1,0,0 - PRODUCTVERSION 17,1,0,0 + FILEVERSION 17,1,1,0 + PRODUCTVERSION 17,1,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "FileDescription", "PathCopyCopy Shell Contextual Menu Extension" - VALUE "FileVersion", "17.1.0.0" + VALUE "FileVersion", "17.1.1.0" VALUE "InternalName", "PathCopyCopy.dll" VALUE "LegalCopyright", "(c) 2008-2019, Charles Lechasseur. See LICENSE.TXT for details." VALUE "OriginalFilename", "PathCopyCopy.dll" VALUE "ProductName", "PathCopyCopy" - VALUE "ProductVersion", "17.1.0.0" + VALUE "ProductVersion", "17.1.1.0" END END BLOCK "VarFileInfo" diff --git a/PathCopyCopyCOMPluginExecutor/rsrc/PathCopyCopyCOMPluginExecutor.rc b/PathCopyCopyCOMPluginExecutor/rsrc/PathCopyCopyCOMPluginExecutor.rc index 83691e4..b14f71e 100644 Binary files a/PathCopyCopyCOMPluginExecutor/rsrc/PathCopyCopyCOMPluginExecutor.rc and b/PathCopyCopyCOMPluginExecutor/rsrc/PathCopyCopyCOMPluginExecutor.rc differ diff --git a/PathCopyCopyRegexTester/rsrc/PathCopyCopyRegexTester.rc b/PathCopyCopyRegexTester/rsrc/PathCopyCopyRegexTester.rc index cf414db..831f143 100644 --- a/PathCopyCopyRegexTester/rsrc/PathCopyCopyRegexTester.rc +++ b/PathCopyCopyRegexTester/rsrc/PathCopyCopyRegexTester.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 17,1,0,0 - PRODUCTVERSION 17,1,0,0 + FILEVERSION 17,1,1,0 + PRODUCTVERSION 17,1,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "FileDescription", "PathCopyCopy Regular Expression Testing Tool" - VALUE "FileVersion", "17.1.0.0" + VALUE "FileVersion", "17.1.1.0" VALUE "InternalName", "PathCopyCopyRegexTester.exe" VALUE "LegalCopyright", "(c) 2012-2019, Charles Lechasseur. See LICENSE.TXT for details." VALUE "OriginalFilename", "PathCopyCopyRegexTester.exe" VALUE "ProductName", "PathCopyCopy" - VALUE "ProductVersion", "17.1.0.0" + VALUE "ProductVersion", "17.1.1.0" END END BLOCK "VarFileInfo" diff --git a/PathCopyCopySettings/Core/UserSettings.cs b/PathCopyCopySettings/Core/UserSettings.cs index a19ad39..d4b253c 100644 --- a/PathCopyCopySettings/Core/UserSettings.cs +++ b/PathCopyCopySettings/Core/UserSettings.cs @@ -23,6 +23,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Drawing; +using System.IO; using Microsoft.Win32; using PathCopyCopy.Settings.Core.Plugins; using PathCopyCopy.Settings.Properties; @@ -751,25 +752,29 @@ public void Dispose() /// /// File where to save the registry data. /// Should use the .reg extension to be importable later. - /// true if the export worked. + /// Export exit code. Will return 0 if successful. /// - /// The /y switch is used when calling reg, meaning that /// will be overwritten without prompt. /// Validate that user wants to overwrite before calling this. /// - public static bool ExportUserSettings(string fileName) + public static int ExportUserSettings(string fileName) { Debug.Assert(!String.IsNullOrEmpty(fileName)); - ProcessStartInfo psi = new ProcessStartInfo("cmd.exe") { - Arguments = String.Format("/c \"reg export HKCU\\{0} \"{1}\" /y\"", + // Can't use the /y switch when calling reg, it's not supported on Win XP. + if (File.Exists(fileName)) { + File.Delete(fileName); + } + + ProcessStartInfo psi = new ProcessStartInfo("reg.exe") { + Arguments = String.Format("export HKCU\\{0} \"{1}\"", PCC_USER_SETTINGS_KEY, fileName), CreateNoWindow = true, UseShellExecute = false, }; using (Process reg = Process.Start(psi)) { reg.WaitForExit(); - return reg.ExitCode == 0; + return reg.ExitCode; } } diff --git a/PathCopyCopySettings/Properties/AssemblyInfo.cs b/PathCopyCopySettings/Properties/AssemblyInfo.cs index e104868..c028880 100644 --- a/PathCopyCopySettings/Properties/AssemblyInfo.cs +++ b/PathCopyCopySettings/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("17.1.0.0")] -[assembly: AssemblyFileVersion("17.1.0.0")] +[assembly: AssemblyVersion("17.1.1.0")] +[assembly: AssemblyFileVersion("17.1.1.0")] diff --git a/PathCopyCopySettings/Properties/Resources.Designer.cs b/PathCopyCopySettings/Properties/Resources.Designer.cs index 2ea1070..1b5b61c 100644 --- a/PathCopyCopySettings/Properties/Resources.Designer.cs +++ b/PathCopyCopySettings/Properties/Resources.Designer.cs @@ -369,7 +369,7 @@ internal static string MainForm_Msg_UserSettingsExportedMsgTitle { } /// - /// Looks up a localized string similar to An error occured while exporting settings to "{0}". Settings have not been successfully exported.. + /// Looks up a localized string similar to An error occured while exporting settings to "{0}". Settings have not been successfully exported. (Exit code: {1}). /// internal static string MainForm_Msg_UserSettingsNotExported { get { diff --git a/PathCopyCopySettings/Properties/Resources.resx b/PathCopyCopySettings/Properties/Resources.resx index 5ab414c..4c7f612 100644 --- a/PathCopyCopySettings/Properties/Resources.resx +++ b/PathCopyCopySettings/Properties/Resources.resx @@ -298,7 +298,7 @@ Control-click to avoid displaying an icon for this command. In order to export settings, changes have to be applied first. Do you want to apply changes now? - An error occured while exporting settings to "{0}". Settings have not been successfully exported. + An error occured while exporting settings to "{0}". Settings have not been successfully exported. (Exit code: {1}) Settings Not Exported diff --git a/PathCopyCopySettings/UI/Forms/MainForm.cs b/PathCopyCopySettings/UI/Forms/MainForm.cs index a75c018..35a274c 100644 --- a/PathCopyCopySettings/UI/Forms/MainForm.cs +++ b/PathCopyCopySettings/UI/Forms/MainForm.cs @@ -679,17 +679,17 @@ private void ExportUserSettingsBtn_Click(object sender, EventArgs e) } } if (canExport && ExportUserSettingsSaveDlg.ShowDialog(this) == DialogResult.OK) { - bool worked; + int exitCode; using (new CursorChanger(this, Cursors.WaitCursor)) { - worked = UserSettings.ExportUserSettings(ExportUserSettingsSaveDlg.FileName); + exitCode = UserSettings.ExportUserSettings(ExportUserSettingsSaveDlg.FileName); } - if (worked) { + if (exitCode == 0) { MessageBox.Show(this, String.Format(Resources.MainForm_Msg_UserSettingsExported, ExportUserSettingsSaveDlg.FileName), Resources.MainForm_Msg_UserSettingsExportedMsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(this, String.Format(Resources.MainForm_Msg_UserSettingsNotExported, - ExportUserSettingsSaveDlg.FileName), Resources.MainForm_Msg_UserSettingsNotExportedMsgTitle, + ExportUserSettingsSaveDlg.FileName, exitCode), Resources.MainForm_Msg_UserSettingsNotExportedMsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); } } diff --git a/Samples/SampleCOMPluginCSharp/SampleCOMPlugin/Properties/AssemblyInfo.cs b/Samples/SampleCOMPluginCSharp/SampleCOMPlugin/Properties/AssemblyInfo.cs index a87a6a3..c2fd2de 100644 --- a/Samples/SampleCOMPluginCSharp/SampleCOMPlugin/Properties/AssemblyInfo.cs +++ b/Samples/SampleCOMPluginCSharp/SampleCOMPlugin/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("17.1.0.0")] -[assembly: AssemblyFileVersion("17.1.0.0")] +[assembly: AssemblyVersion("17.1.1.0")] +[assembly: AssemblyFileVersion("17.1.1.0")] diff --git a/Samples/SampleCOMPluginCpp/SampleCOMPlugin/SampleCOMPlugin.rc b/Samples/SampleCOMPluginCpp/SampleCOMPlugin/SampleCOMPlugin.rc index ce4024a..5528ff2 100644 --- a/Samples/SampleCOMPluginCpp/SampleCOMPlugin/SampleCOMPlugin.rc +++ b/Samples/SampleCOMPluginCpp/SampleCOMPlugin/SampleCOMPlugin.rc @@ -57,8 +57,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 17,1,0,0 - PRODUCTVERSION 17,1,0,0 + FILEVERSION 17,1,1,0 + PRODUCTVERSION 17,1,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "FileDescription", "Sample Path Copy Copy C++ COM Plugin" - VALUE "FileVersion", "17.1.0.0" + VALUE "FileVersion", "17.1.1.0" VALUE "InternalName", "SampleCOMPlugin.dll" VALUE "LegalCopyright", "(c) 2010-2019, Charles Lechasseur. See LICENSE.TXT for details." VALUE "OriginalFilename", "SampleCOMPlugin.dll" VALUE "ProductName", "Sample Path Copy Copy C++ COM Plugin" - VALUE "ProductVersion", "17.1.0.0" + VALUE "ProductVersion", "17.1.1.0" END END BLOCK "VarFileInfo" diff --git a/Testing/TestPlugins/rsrc/TestPlugins.rc b/Testing/TestPlugins/rsrc/TestPlugins.rc index d4b32ff..1e561ff 100644 --- a/Testing/TestPlugins/rsrc/TestPlugins.rc +++ b/Testing/TestPlugins/rsrc/TestPlugins.rc @@ -57,8 +57,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 17,1,0,0 - PRODUCTVERSION 17,1,0,0 + FILEVERSION 17,1,1,0 + PRODUCTVERSION 17,1,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "FileDescription", "PathCopyCopy Test Plugins Module" - VALUE "FileVersion", "17.1.0.0" + VALUE "FileVersion", "17.1.1.0" VALUE "InternalName", "TestPlugins.dll" VALUE "LegalCopyright", "(c) 2011-2019, Charles Lechasseur. See LICENSE.TXT for details." VALUE "OriginalFilename", "TestPlugins.dll" VALUE "ProductName", "TestPlugins" - VALUE "ProductVersion", "17.1.0.0" + VALUE "ProductVersion", "17.1.1.0" END END BLOCK "VarFileInfo"