Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
別のバージョンがインストールされている際にエラーを表示&既定のプロファイル名を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Takym committed Apr 11, 2020
1 parent a5161ff commit 96aedbb
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 9 deletions.
27 changes: 18 additions & 9 deletions AupLauncher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public static class Program
public const string Description = "Launcher for AviUtl & Audacity Project Files";
public const string Author = "Takym";
public const string Copyright = "Copyright (C) 2020 Takym.";
public const string Version = "0.0.0.6";
public const string CodeName = "aupl00a6";
public const string Version = "0.0.0.7";
public const string CodeName = "aupl00a7";

public static Settings Settings { get; private set; }

Expand All @@ -38,8 +38,15 @@ internal static int Main(string[] args)
}
}
#if !DEBUG
} catch (NotSupportedException nse) {
MessageBox.Show(
Resources.Message_AnotherVersionInstalled,
Caption,
MessageBoxButtons.OK,
MessageBoxIcon.Error);
return SaveErrorReport(nse, true);
} catch (Exception e) {
return SaveErrorReport(e);
return SaveErrorReport(e, true);
#endif
}
}
Expand Down Expand Up @@ -156,7 +163,7 @@ public static string CreateArgs(string format, string args)
}
}

public static int SaveErrorReport(Exception e)
public static int SaveErrorReport(Exception e, bool showMsg)
{
var dt = DateTime.Now;
int pid = Process.GetCurrentProcess().Id;
Expand Down Expand Up @@ -195,11 +202,13 @@ public static int SaveErrorReport(Exception e)
e = e.InnerException; ++n;
} while (e != null);
}
MessageBox.Show(
string.Format(Resources.Message_ErrorReport, msg, fname),
Caption,
MessageBoxButtons.OK,
MessageBoxIcon.Error);
if (showMsg) {
MessageBox.Show(
string.Format(Resources.Message_ErrorReport, msg, fname),
Caption,
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
return ret;
}

Expand Down
9 changes: 9 additions & 0 deletions AupLauncher/Properties/Resources.Designer.cs

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

3 changes: 3 additions & 0 deletions AupLauncher/Properties/Resources.en.resx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@
<data name="ER_Line8_Title" xml:space="preserve">
<value>## Exception Information ({0})</value>
</data>
<data name="Message_AnotherVersionInstalled" xml:space="preserve">
<value>The another version of this program is already installed on your computer.</value>
</data>
<data name="Message_ConfirmClosing" xml:space="preserve">
<value>Settings are changed. Do you want to save?
If you click [Yes] button, save changes and close.
Expand Down
3 changes: 3 additions & 0 deletions AupLauncher/Properties/Resources.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@
<data name="ER_Line8_Title" xml:space="preserve">
<value>□例外の情報 ({0})</value>
</data>
<data name="Message_AnotherVersionInstalled" xml:space="preserve">
<value>既に別のバージョンがインストールされているため、起動できません。</value>
</data>
<data name="Message_ConfirmClosing" xml:space="preserve">
<value>設定が変更されています。保存しますか?
[はい]を押すと変更を保存し終了します。
Expand Down
3 changes: 3 additions & 0 deletions AupLauncher/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@
<data name="ER_Line8_Title" xml:space="preserve">
<value>ER_Line8_Title {0}</value>
</data>
<data name="Message_AnotherVersionInstalled" xml:space="preserve">
<value>Message_AnotherVersionInstalled</value>
</data>
<data name="Message_ConfirmClosing" xml:space="preserve">
<value>Message_ConfirmClosing</value>
</data>
Expand Down
1 change: 1 addition & 0 deletions AupLauncher/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public void SaveToRegistry()
if (this.IsDisposed) {
throw new ObjectDisposedException(nameof(Settings));
}
this.Default.DisplayName = Resources.DefaultProfileDisplayName; // TODO: 不具合の応急措置
_reg.SetValue("SavedVersion", Program.Version, RegistryValueKind.String);
_reg.SetValue("DefaultProfile", _defkey, RegistryValueKind.String);
var delList = new List<string>();
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Windows 10 (1909)
## バージョン履歴
|バージョン|開発コード名|更新日 |内容 |
|:--------:|:----------:|:---------|:----------------------------------------------------------------------------------------------|
|v0.0.0.7 |aupl00a7 |2020/04/11|別のバージョンがインストールされている時に、エラーを正しく処理する様にした。 |
|v0.0.0.6 |aupl00a6 |2020/04/04|無効なファイルの処理の「無効な値」を非表示にした。 |
|v0.0.0.5 |aupl00a5 |2020/04/03|説明書きを分かり易く修正。 |
|v0.0.0.4 |aupl00a4 |2020/03/31|ファイル名の空白を正しく処理する様にした。 |
Expand Down Expand Up @@ -100,6 +101,7 @@ Please refer [LICENSE.txt](LICENSE.txt) for more information.
## Change Log
|Version |Code Name |Update |Changes |
|:--------:|:----------:|:---------|:----------------------------------------------------------------------------------------|
|v0.0.0.7 |aupl00a7 |2020/04/11|Fixed to handle an error when an another version is installed. |
|v0.0.0.6 |aupl00a6 |2020/04/04|Invisibled the "invalid value" item of handles for an invalid file. |
|v0.0.0.5 |aupl00a5 |2020/04/03|Fixed this manual friendly only. |
|v0.0.0.4 |aupl00a4 |2020/03/31|Fixed to process for blanks in a file name. |
Expand Down

0 comments on commit 96aedbb

Please sign in to comment.