Closed caver456 closed 1 year ago
This stackoverflow thread looks helpful too: https://stackoverflow.com/questions/27195594 - it might be easier to embed gsprint than to embed Acrobat Reader, and the thread implies that you can specify the path to the viewer, which should get rid of the need to have a system default viewer.
The plan:
@RadiosPRN confirms: installing Acrobat Reader allowed all pdf files to be saved.
Looks like there are a few choices on how to do the installation-time check. It would be nice to see if there is a default pdf viewer application already installed, but that seems like it might not be that robust, and requires running something with elevated permissions - shouldn't technically be a problem since the installer is running with elevated permissions anyway so as to do the all-users install (which triggers the UAC), but it would be nice to not run any more programs than required:
Instead, we could bypass the default app check, and just check the registry for Acrobat or Acrobat Reader, and offer to install it if not already installed. This offer should also show the explanation of why Acrobat Reader (or, a default pdf viewer application other than a web browser) is needed.
If Acrobat Reader DC is installed, this registry entry will exist: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Acrobat.exe (or maybe AcroRd32.exe according to an old post).
If this registry entry is not found, show the message (and offer to install if possible).
Looks like there are several ways to show the info in Inno Setup:
The last option will probably look and feel the best, and shouldn't take too much coding. Can include an image or two - a big PDF icon and a big printer icon should grab the user's attention. https://stackoverflow.com/questions/43696537
Went with the middle option (MsgBox) instead, since it is a MUCH lighter weight change, and still grabs attention possibly better than a custom page.
From the transcript:
This was reported by @RadiosPRN.
A quick google of that error shows that a few folks determined that the problem was that no pdf reader application was installed, and/or it was not set as the default application for opening pdf files: https://stackoverflow.com/questions/36022695
Sure enough, if I uninstall Acrobat Reader, then printing from radiolog shows this:
The error syntax is a bit different - not sure why - but the underlying error 31 seems to be the same.
This does match the behavior of what @RadiosPRN reported - you can only save one pdf file at a time, because the print failure for any given doc causes the subsequent pdf saves to be skipped.
So this issue could have two fixes: 1) find a way to print without needing a pdf reader to be installed (and set as the default application for pdfs) 2) if a print fails, continue with the save of the other requested pdfs