diff --git a/install_script/AddScheduledTask.bat b/install_script/AddScheduledTask.bat new file mode 100644 index 00000000..aea213ae --- /dev/null +++ b/install_script/AddScheduledTask.bat @@ -0,0 +1,3 @@ +@echo off +set AppPath=%1 +schtasks /Create /TN "MonApplication" /TR "\"%AppPath%\"" /SC ONLOGON /RL HIGHEST /F diff --git a/setup.iss b/setup.iss index 14f960b6..67ba2583 100644 --- a/setup.iss +++ b/setup.iss @@ -15,7 +15,7 @@ #define MyAppExeName "Lanceur.exe" [Setup] -PrivilegesRequired=admin +PrivilegesRequired=none ; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) @@ -38,11 +38,19 @@ Name: "english"; MessagesFile: "compiler:Default.isl" [Tasks] Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked -; Name: startup; Description: "Automatically start on login"; GroupDescription: "{cm:AdditionalIcons}" +; Chose how the appplications starts up +Name: "startregistry"; Description: "Start the application via the registry"; GroupDescription: "Startup options" +Name: "starttask"; Description: "Start the application via a scheduled task"; GroupDescription: "Startup options" [Registry] Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Lanceur 2"; ValueData: """{app}\{#MyAppExeName}"""; Flags: uninsdeletevalue +[Run] +Filename: "{app}\AddScheduledTask.bat"; Parameters: """{app}\{#MyAppExeName}"""; Flags: runhidden; Tasks: starttask + +[UninstallRun] +Filename: "schtasks"; Parameters: "/Delete /TN {#MyAppName} /F"; Flags: runhidden + [Files] Source: "{#BinDirectory}{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion Source: "{#BinDirectory}*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs