diff --git a/Directory.Build.props b/Directory.Build.props index 65b6f43..434a152 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 0.1.0 + 0.1.1 Justin Paul Justin Paul Webhook Server diff --git a/installer/webhook-server.iss b/installer/webhook-server.iss index 36c7314..5e940c8 100644 --- a/installer/webhook-server.iss +++ b/installer/webhook-server.iss @@ -77,3 +77,18 @@ Filename: "powershell.exe"; \ Parameters: "-NoProfile -ExecutionPolicy Bypass -File ""{app}\scripts\uninstall-service.ps1"""; \ Flags: runhidden; \ RunOnceId: "RemoveWebhookService" + +[Code] +function PrepareToInstall(var NeedsRestart: Boolean): String; +var + ResultCode: Integer; +begin + Result := ''; + // Stop the running service so its binaries are unlocked before file copy. + // Ignore failure - sc returns non-zero if the service doesn't exist (fresh + // install) or is already stopped, both of which are fine. + Exec(ExpandConstant('{sys}\sc.exe'), 'stop WebhookServer', '', SW_HIDE, + ewWaitUntilTerminated, ResultCode); + // Give the SCM a moment to actually release the executable. + Sleep(2000); +end; diff --git a/src/WebhookServer.Gui/WebhookServer.Gui.csproj b/src/WebhookServer.Gui/WebhookServer.Gui.csproj index 8308673..c0415de 100644 --- a/src/WebhookServer.Gui/WebhookServer.Gui.csproj +++ b/src/WebhookServer.Gui/WebhookServer.Gui.csproj @@ -16,6 +16,7 @@ true true ..\..\resources\webhook-server.ico + app.manifest Webhook Server diff --git a/src/WebhookServer.Gui/app.manifest b/src/WebhookServer.Gui/app.manifest new file mode 100644 index 0000000..fe654a1 --- /dev/null +++ b/src/WebhookServer.Gui/app.manifest @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + +