Run an application shortcut after an install: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Updated author links.)
m (Adding new author and category links.)
Line 1: Line 1:
{|align=right
{{PageAuthor|jpannequin}}
|<small>Author: [[{{ns:2}}:jpannequin|jpannequin]] ([[{{ns:3}}:jpannequin|talk]], [[{{ns:-1}}:Contributions/jpannequin|contrib]])</small>
 
|}
<br style="clear:both;">
== Description ==
== Description ==
Here is how to launch a shortcut at the end of an install (in the MUI). You may need this if you need to use a specific working directory and don't want to modify the MUI.
Here is how to launch a shortcut at the end of an install (in the MUI). You may need this if you need to use a specific working directory and don't want to modify the MUI.

Revision as of 13:45, 24 June 2005

Author: jpannequin (talk, contrib)


Description

Here is how to launch a shortcut at the end of an install (in the MUI). You may need this if you need to use a specific working directory and don't want to modify the MUI.

Usage

So suppose I want to launch "C:\User\test.lnk".

Before calling the macro for finish, you must define the run variables. If you define

!define MUI_FINISHPAGE_RUN "C:\User\test.lnk"

it will not work, because it is not an application.

You must set MUI_FINISHPAGE_RUN empty, and use a function instead.

!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "Start a shortcut"
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
!insertmacro MUI_PAGE_FINISH

You can then define the function and execute the link with ExecShell.

Function LaunchLink
  ExecShell "" "C:\User\test.lnk"
FunctionEnd