![]() |
#1 |
Junior Member
Join Date: May 2006
Posts: 24
|
How can I add a shortcut to Startup folder?
Hello,
I am wondering how I add a shortcut of my program to Startup folder? Please help. Thanks. |
![]() |
![]() |
![]() |
#2 |
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
code: A Few notes:
|
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: May 2006
Posts: 24
|
Thanks!
What's "some command line parameters" or "a description"? Should I leave it as is? |
![]() |
![]() |
![]() |
#4 |
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
"some command line parameters"
This would be extra command line parmaters for the EXE. Normally, this would be null (""). "a desciption" This can be anything you want. It just serves as a way to describe the shortcut. It can be blank if you wish. |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: May 2006
Posts: 24
|
Really appreciate your help. Thanks
![]() |
![]() |
![]() |
![]() |
#6 |
Junior Member
Join Date: May 2006
Posts: 24
|
But the shortcut icon is not showing. I am getting the default windows exe icon
![]() What's wrong? |
![]() |
![]() |
![]() |
#7 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 893
|
Keep it simple:
code: "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,333
|
the correct folder variable is $SMSTARTUP not $SMPROGRAMS\Startup so the instructions should be: CreateShortCut "$SMSTARTUP\My Program.lnk" "$INSTDIR\My Program.exe"
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#9 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 893
|
Good point. Our mistake.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#10 |
Junior Member
Join Date: May 2006
Posts: 24
|
Thanks guys for your follow-ups. But as I have mentionned:
The shortcut icon is not showing. I am getting the default windows exe icon... What's wrong? |
![]() |
![]() |
![]() |
#11 |
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
Is it just the icon that is messed up or is the entire shortcut screwed up? What was the exact command you used in your script?
|
![]() |
![]() |
![]() |
#12 | |
Junior Member
Join Date: May 2006
Posts: 24
|
Everything is working fine, but the icon is not showing up.
SetShellVarContext all CreateShortCut "$SMSTARTUP\my prog.lnk" "$INSTDIR\my prog.exe" \ "" "$INSTDIR\my prog.exe" 2 SW_SHOWNORMAL \ ALT|CTRL|SHIFT|F5 "Do not delete this shortcut!" I found this on the manual but I didn't get it. Quote:
|
|
![]() |
![]() |
![]() |
#13 |
Junior Member
Join Date: May 2006
Posts: 24
|
Ok, it worked when I did:
CreateShortCut "$SMSTARTUP\My Program.lnk" "$INSTDIR\My Program.exe" "hourglass.ico" But how can I add the comment: "Do not delete this shortcut"? |
![]() |
![]() |
![]() |
#14 |
Junior Member
Join Date: May 2006
Posts: 24
|
And...
This is not working also: Section "Uninstall" Delete "$INSTDIR\Uninstall My Program.exe" Delete "$INSTDIR\My Program.exe" RMDir $INSTDIR Delete "$SMSTARTUP\My Program.lnk" <------- Everything is ok, except this line. It doesn't remove the shortcut! SectionEnd Please help. Thanks. |
![]() |
![]() |
![]() |
#15 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 893
|
Please, PLEEEEEESE do not double post. They are often ignored, or people will stop posting.
Shortcut description: code: "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#16 |
Junior Member
Join Date: May 2006
Posts: 24
|
It worked
I'm really, Realllllly sorry
![]() |
![]() |
![]() |
![]() |
#17 |
Junior Member
Join Date: Jun 2013
Posts: 2
|
Actually you can add program path to registry "Run" key as well. If you add program to Start Menu/Startup folder, users can easily remove them by "Right Click->Delete". This post describes how to start program automatically in several ways, Also RunOnce key is an available option.
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|