Run an application shortcut after an install: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Updated author and download links, and changed format of some pages.)
m (Updated author links.)
Line 1: Line 1:
{|align=right
|<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.
Line 23: Line 27:
FunctionEnd
FunctionEnd
</highlight-nsis>
</highlight-nsis>
Page author: [[User:jpannequin|jpannequin]]

Revision as of 03:03, 30 April 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