Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno Setup: How to launch Adobe Reader and display a PDF

I am trying to launch Adobe Reader at the end of the install to display a readme file. I am using PDF because I need to display some images. My inno setup script is failing with "Unable to execute file: Create Process failed; code 267, the directory name is invalid."

I have tried with and without quote around Filename: The path has spaces, however, reading the documentation, inno will take care of path with spaces (is that correct?).

BTW - Adobe is installed (or the user has to install it before installing the application) In my case it is already installed.

The code snipet that I am using:

[Tasks]
Name: StartAfterInstall; Description: Display the PDF Readme File

[Run]
Filename: "{reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe,@AcroRd32.exe} {app}\readme.pdf"; Tasks: StartAfterInstall
like image 684
user2578083 Avatar asked Sep 08 '14 20:09

user2578083


1 Answers

Prefer opening your PDF file in the user's default PDF viewer. That's what you can do when you specify the shellexec flag in the [Run] section entry for your PDF file. This flag will let your file be opened by the Windows Shell which will use the application registered for the PDF extension:

[Tasks]
Name: StartAfterInstall; Description: Display the PDF Readme File

[Run]
Filename: "{app}\readme.pdf"; Tasks: StartAfterInstall; Flags: shellexec runasoriginaluser
like image 165
TLama Avatar answered Oct 23 '22 03:10

TLama