对于 Inno Setup,我想在 Windows 启动时为 MyAPP Auto Start 创建一个复选框 Task。我的代码如下:
而且,如何编写以下代码 - DO_Set_AutoStart_WhenWindowsStart() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Tasks]
Name: "StartMenuEntry" ; Description: "Start my app when Windows starts" ; GroupDescription: "Windows Startup"; MinVersion: 4,4;
[code]
//Do Additional Task - Auto Start when Windows Start
function NextButtonClick(CurPageID: Integer): Boolean;
var
Index: Integer;
begin
Result := True;
if CurPageID = wpSelectTasks then
begin
Index := WizardForm.TasksList.Items.IndexOf('Start my app when Windows starts');
if Index <> -1 then
begin
if WizardForm.TasksList.Checked[Index] then
MsgBox('First task has been checked.', mbInformation, MB_OK)
DO_Set_AutoStart_WhenWindowsStart();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
else
MsgBox('First task has NOT been checked.', mbInformation, MB_OK);
end;
end;
end;