Skip to content
⌘ NSIS Forum Archive

Nsis mui_finishpage_run

7 posts

RainerHH#

Nsis mui_finishpage_run

I understand why?

If I use

!define MUI_FINISHPAGE_RUN notepad.ex

it works, notepad starts

It I use

!define MUI_FINISHPAGE_RUN winword.exe

nothing happens

If I use in windows executing window winword.exe without path, ist starts !
Nutzzz#
The run box is different from the NSIS environment. Try it in a cmd window, and you'll find it doesn't find winword.exe from there.

I suggest checking the registry for the full path, and define it that way. This should work:
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe" "Path"
!define MUI_FINISHPAGE_RUN "$0\Winword.exe"
Of course, you should deal with the case where Word is not installed.
RainerHH#
I have just this reg entry used:
ReadRegStr $R9 HKCU Software\Microsoft\Office\15.0\Word\Options "PROGRAMDIR"
Nutzzz#
But that's a particular version of Word. You'd have to have more logic to determine which version is installed.
Are you sure you are checking in HKLM?
Anders#
Originally Posted by Nutzzz View Post

I suggest checking the registry for the full path, and define it that way. This should work:
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe" "Path"
!define MUI_FINISHPAGE_RUN "$0\Winword.exe"
This is not correct, that path value is optional and can contain other paths. The default value in that key is supposed to have the full path to the exe.
Nutzzz#
Originally Posted by Anders View Post
This is not correct, that path value is optional and can contain other paths. The default value in that key is supposed to have the full path to the exe.
Thanks for the clarification.