Skip to content

Commit

Permalink
Merge branch 'issue/96'
Browse files Browse the repository at this point in the history
  • Loading branch information
clechasseur committed Nov 17, 2019
2 parents 88a5847 + 7212639 commit fa912e7
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 41 deletions.
6 changes: 6 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
18 changes: 9 additions & 9 deletions Installer/Setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
8 changes: 4 additions & 4 deletions PathCopyCopy/rsrc/PathCopyCopy.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions PathCopyCopyRegexTester/rsrc/PathCopyCopyRegexTester.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
17 changes: 11 additions & 6 deletions PathCopyCopySettings/Core/UserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -751,25 +752,29 @@ public void Dispose()
/// </summary>
/// <param name="fileName">File where to save the registry data.
/// Should use the <c>.reg</c> extension to be importable later.</param>
/// <returns><c>true</c> if the export worked.</returns>
/// <returns>Export exit code. Will return 0 if successful.</returns>
/// <remarks>
/// The <c>/y</c> switch is used when calling <c>reg</c>, meaning that
/// <paramref name="fileName"/> will be overwritten without prompt.
/// Validate that user wants to overwrite before calling this.
/// </remarks>
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;
}
}

Expand Down
4 changes: 2 additions & 2 deletions PathCopyCopySettings/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
2 changes: 1 addition & 1 deletion PathCopyCopySettings/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion PathCopyCopySettings/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Control-click to avoid displaying an icon for this command.</value>
<value>In order to export settings, changes have to be applied first. Do you want to apply changes now?</value>
</data>
<data name="MainForm_Msg_UserSettingsNotExported" xml:space="preserve">
<value>An error occured while exporting settings to "{0}". Settings have not been successfully exported.</value>
<value>An error occured while exporting settings to "{0}". Settings have not been successfully exported. (Exit code: {1})</value>
</data>
<data name="MainForm_Msg_UserSettingsNotExportedMsgTitle" xml:space="preserve">
<value>Settings Not Exported</value>
Expand Down
8 changes: 4 additions & 4 deletions PathCopyCopySettings/UI/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
8 changes: 4 additions & 4 deletions Samples/SampleCOMPluginCpp/SampleCOMPlugin/SampleCOMPlugin.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions Testing/TestPlugins/rsrc/TestPlugins.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit fa912e7

Please sign in to comment.