方法1:不修改注册表
有一种不写注册表的方法,其实就是将快捷方式添加到“启动”文件夹
[Tasks]
Name: "startupicon"; Description: "开机启动"; GroupDescription: "{cm:AdditionalIcons}"; OnlyBelowVersion: 0,6.1
[Icons]
Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
方法2:修改注册表方式 //注册表启动项
[Registry]
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "testrun"; ValueData: "{app}\{#MyAppExeName}"