Simple example to conditionally create a shortcut?
I have an optional section and a "Create shortcuts" section. I would like to create a shortcut for the files installed in the optional section only if it was selected to install. I know this is simple, but I've searched and I can't find a simple example that shows how to do this, and I'm not familiar enough with the scripting language to figure it out. Can someone post an example to fill in the blanks?
Section "Optional"
File "opt.exe"
; What do I add to create some global variable?
SectionEnd
Section "Shortcuts"
CreateDirectory "$SMPROGRAMS\Ex"
CreateShortCut "$SMPROGRAMS\Ex\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "" 0
; Now what do I add to conditionally create this shortcut?
CreatShortCut "$SMPROGRMAMS\Ex\Opt.lnk" "$INSTDIR\opt.exe" "" "" 0
SectionEnd