Menu

#1223 MUI_FINISHPAGE_SHOWREADME hanging Acrobat reader on Windows10

2.0 Series
open
nobody
None
5
2020-01-04
2019-03-19
No

I use MUI_FINISHPAGE_SHOWREADME to open a pdf at the end of an installer. (NSIS 2.45 / MUI 1). This has worked fine for years when tested on windows7 or earlier. Now i started testing the installer in W10, and it seems that the pdf file never opens.
Before running the installer, acrobat reader can open any pdf including the one in the installer. After the installer has tried opening the pdf, AcroRd32.exe is still running, and until i kill it, i can not anymore open another pdf manually.

I am an admin user and try to run the installer as admin, but this changes nothing.
I tried running in a command line the same command that has been run by the installer (optained from task manager process properties, a simple path/to/acrord32.exe path/to/my.pdf) and this works perfectly

Did someone see such behaviour with W10?

Discussion

  • Anders

    Anders - 2019-03-19

    NSIS 2.x just calls ShellExecute which is the correct way to open a file-type in their default program.

    It is possible that Acrobat Reader has not initialized correctly when that call returns. You can try to work around that by adding a delay:

    ...
    !insertmacro MUI_PAGE_INSTFILES
    !define MUI_FINISHPAGE_SHOWREADME ""
    !define MUI_FINISHPAGE_SHOWREADME_FUNCTION FinishReadmeWithDelay
    !insertmacro MUI_PAGE_FINISH
    !insertmacro MUI_LANGUAGE English
    
    Function FinishReadmeWithDelay
    ExecShell "" "$InstDir\MyFile.pdf"
    Sleep 2222
    FunctionEnd
    

    If you are using NSIS 3 you could try

    ExecShell /WAITFORINPUTIDLE "" "$InstDir\MyFile.pdf"
    

    or

    ExecShell /INVOKEIDLIST "" "$InstDir\MyFile.pdf"
    
     

    Last edit: Anders 2019-03-19
  • olivier barthelemy

    It seems not totally by windows 10, but caused by acrobat reader protected startup. Disableing it makes the problem disappear. Not realy sure if there is a workaround, or if i should live with the fact that users with that acrobat reader setting will not be able to read PDFs from the installer

     
  • Benjamin Foucher

    Seems like Acrobat Reader won't open PDF files from an elevated process (RequestExecutionLevel admin) using ShellExecute (that the default showreadme uses) under Windows 10/UAC.

    Anders workaround to sleep during ShellExec does not work.

    However, it seems that an NSIS plugin does exist to run unelevated commands and when used in a function (MUI_FINISHPAGE_SHOWREADME_FUNCTION ), this perfectly workaounds the issue.

    If this can help someone...

     
    • Anders

      Anders - 2020-01-04

      The woraround will only work for buggy in-process shell extensions, not something that just refuses to run correctly if started at high IL.

       

Log in to post a comment.

MongoDB Logo MongoDB