Archive: Quick launch control


Quick launch control
This should be a simple question hopefully.

I want to ask the user if they want a quick launch shortcut created. How do I make the message box only pop-up when the shortcut page is showing? Currently it pops up when the installer is installer files which is too early.

Many thanks


Shortcut page? Do you mean Finish page?

You could put it in Function .onInstSuccess so then it is called when installaation succeeds...

-Stu


Originally posted by Afrow UK
Shortcut page? Do you mean Finish page?

You could put it in Function .onInstSuccess so then it is called when installaation succeeds...

-Stu
You know on the page where it allows to make start menu shortcuts.

Ideally if when a user clicks "next" there it would popup and ask them then.

From what I read .onInstSuccess means it will popup after the installer closes making it more suitable to a readme type question.

Ah right, in that case (if you are using MUI):

!define MUI_PAGE_CUSTOMFUNCTION_LEAVE PromptQLShortcut
!insertmacro MUI_PAGE_STARTMENU ... ...

Function PromptQLShortcut

MessageBox MB_YESNO|MB_ICONQUESTION ...


FunctionEnd


-Stu

Originally posted by Afrow UK
Ah right, in that case (if you are using MUI):
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE PromptQLShortcut
!insertmacro MUI_PAGE_STARTMENU ... ...

Function PromptQLShortcut

MessageBox MB_YESNO|MB_ICONQUESTION ...


FunctionEnd


-Stu
Right so just to be sure I put the code in the right order what is below is entirely external to the Installer section right?

Function PromptQLShortcut

MessageBox MB_YESNO|MB_ICONQUESTION ...

FunctionEnd

Also is the below supposed to be one line?

!define MUI_PAGE_CUSTOMFUNCTION_LEAVE PromptQLShortcut
!insertmacro MUI_PAGE_STARTMENU ... ...

I'm a little confused what !insertmacro MUI_PAGE_STARTMENU ... ...
does and where would that line be put....

Yes it is all outside of Sections and Functions (as you cannot place Functions inside other Functions or Sections).

You should already have
!insertmacro MUI_PAGE_STARTMENU ... ...
in your script. You just need to append your current script with this.

-Stu


Works great now thanks.....

Just one more question, assuming a user chooses not to make a quick luanch shortcut is there any harm if we delete a non existing link within the uninstaller?

In other words should we add some kind of stored setting indiciating if the uninstaller needs to delete it later?


Originally posted by GFORCE100
In other words should we add some kind of stored setting indiciating if the uninstaller needs to delete it later?
No, you don't need to store a setting. There is no harm in trying to delete a file that doesn't exist. The error flag will not be set.

Okay so it's just like in Windows, thaks.


For future reference you can simply use:

IfFileExists "$QUICKLAUNCH\MyApp.lnk" 0 +2
Delete "$QUICKLAUNCH\MyApp.lnk"

But as deritrus says, you don't really have to check whether it exists or not.

-Stu