Skip to content

Commit

Permalink
updateスクリプト起動場所を変更した
Browse files Browse the repository at this point in the history
  • Loading branch information
anoyetta committed Sep 25, 2021
1 parent 7b872fc commit 8801de5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion source/@MasterVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v9.4.2
v9.4.3
4 changes: 2 additions & 2 deletions source/ACT.Hojoring.Common/Version.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;

[assembly: AssemblyVersion("9.4.0.2")]
[assembly: AssemblyFileVersion("9.4.0.2")]
[assembly: AssemblyVersion("9.4.0.3")]
[assembly: AssemblyFileVersion("9.4.0.3")]
15 changes: 12 additions & 3 deletions source/FFXIV.Framework/FFXIV.Framework/Common/UpdateChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,16 @@ public static string Update(
public static async void StartUpdateScript(
bool usePreRelease = false)
{
var cd = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var cd = DirectoryHelper.GetPluginRootDirectoryDelegate?.Invoke();
if (string.IsNullOrEmpty(cd))
{
cd = Path.Combine(
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
"..");

cd = Path.GetFullPath(cd);
}

var script = Path.Combine(cd, "update_hojoring.ps1");

using (var web = new WebClient())
Expand All @@ -331,9 +340,9 @@ await web.DownloadFileTaskAsync(

if (File.Exists(script))
{
var args = $"-NoLog -NoProfile -ExecutionPolicy Unrestricted -File \"{script}\" {usePreRelease}";
var args = $"-NoLogo -NoProfile -ExecutionPolicy Unrestricted -File \"{script}\" {usePreRelease}";

Process.Start("powershell.exe", args);
Process.Start(EnvironmentHelper.Pwsh, args);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public Task WaitDownloadingAsync()
{
while (true)
{
lock (Random)
lock (Locker)
{
if (!this.isDownloading)
{
Expand Down

0 comments on commit 8801de5

Please sign in to comment.