When trying to achieve that my installer restarts automatically after rebooting, I tried to do it like this:
CreateShortCut "$SMSTARTUP\Startup Test.lnk" "$CMDLINE"
The CMDLINE variable seems to be correct.
CreateShortCut also seems to work well when not using it in conjunction with CMDLINE.
However, the link that is created looks like this:
"C:\"E:\Munka\t\StartupTest_Setup.exe" "
Tested with version 2.20 and 2.41, same result.
Sample installer code attached!
Please use this email address if more information is needed: kovacsp at sch.bme.hu
Thanks,
Peter
Sample repro code
CreateShortcut has a different parameter for the executable and the parameters. Pass $EXEPATH as the executable and use ${GetParemeters} for the parameters.