Updater: quote name of task to run, making it safe to use white spaces

This commit is contained in:
Ansgar Becker
2023-01-04 19:45:37 +01:00
parent 3ea12a4357
commit 4fd9b87767
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ program updater;
{$R manifest.RES}
// (un)comment the following resource inclusion to vary the binary size. Update checker trusts the same file size before overwriting the old one.
{.$R ..\icon.RES}
{$R ..\icon.RES}
uses
Winapi.Windows, Winapi.Messages, Winapi.TlHelp32, Winapi.PsAPI, Winapi.ShellAPI, System.SysUtils;
@ -169,7 +169,7 @@ begin
DeleteFile(PChar(DownloadPath));
Status('Success. Restarting '+AppName+' through task "'+RestartTaskName+'" now ...');
RestartCmd := 'schtasks';
RestartParams := '/Run /TN ' + RestartTaskName;
RestartParams := '/Run /TN "' + RestartTaskName + '"';
ShellExecute(0, 'open', PChar(RestartCmd), PChar(RestartParams), '', SW_HIDE);
end;

Binary file not shown.