Compare commits

...
2 Commits
Author SHA1 Message Date
Alexandru Macocian 9fd7d8b62a Ask for execution policy change before running script. 2021-04-09 17:19:34 +02:00
Alexandru Macocian a9aa73033f Update to 0.2 2021-04-09 15:56:11 +02:00
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<LangVersion>preview</LangVersion>
<ApplicationIcon>Daybreak.ico</ApplicationIcon>
<Version>0.1.4</Version>
<Version>0.2.1</Version>
</PropertyGroup>
<ItemGroup>
@@ -22,6 +22,7 @@ namespace Daybreak.Services.Updater
private const string OutputPathTag = "{OUTPUTPATh}";
private const string Url = "https://github.com/AlexMacocian/Daybreak/releases/latest";
private const string DownloadUrl = $"https://github.com/AlexMacocian/Daybreak/releases/download/v{VersionTag}/Daybreakv{VersionTag}.zip";
private const string SetExecutionPolicy = $"Set-ExecutionPolicy RemoteSigned -Scope CurrentUser";
private const string DelayCommand = "Start-Sleep -m 3000";
private const string ExtractCommandTemplate = $"Expand-Archive -Path '{InputFileTag}' -DestinationPath '{OutputPathTag}' -Force";
private const string RunClientCommand = @".\Daybreak.exe";
@@ -99,7 +100,8 @@ namespace Daybreak.Services.Updater
public void FinalizeUpdate()
{
File.WriteAllLines(ExtractAndRunPs1, new List<string>()
{
{
SetExecutionPolicy,
DelayCommand,
ExtractCommandTemplate
.Replace(InputFileTag, Path.GetFullPath(TempFile))