Windows 8 NSIS-Windows 8 PDF查看器,即glcnd.exe-如何从NSIS启动以显示自述文件

Windows 8 NSIS-Windows 8 PDF查看器,即glcnd.exe-如何从NSIS启动以显示自述文件,windows-8,nsis,Windows 8,Nsis,您好,我正在尝试启动专用的Windows 8 PDF查看器,以便在Windows 8中显示自述文件 我想使用ExecShell或等效方法。没有为Windows 8 viewer参数化exe输入的文档 有人有什么建议吗?我认为强制使用特定的应用程序不是一个好主意,但你可以这样做: !include LogicLib.nsh !define pdffile "$desktop\test.pdf" !define ReaderAppId "Microsoft.Reader_8wekyb3d8bbwe

您好,我正在尝试启动专用的Windows 8 PDF查看器,以便在Windows 8中显示自述文件

我想使用ExecShell或等效方法。没有为Windows 8 viewer参数化exe输入的文档


有人有什么建议吗?

我认为强制使用特定的应用程序不是一个好主意,但你可以这样做:

!include LogicLib.nsh
!define pdffile "$desktop\test.pdf" 
!define ReaderAppId "Microsoft.Reader_8wekyb3d8bbwe!Microsoft.Reader" ; This is probably unique per machine/user
!define CLSCTX_LOCAL_SERVER 0x4
!define IID_IShellItem {43826d1e-e718-42ee-bc55-a1e261c37bfe}
!define IID_IShellItemArray {B63EA76D-1F85-456F-A19C-48159EFA858B}
!define CLSID_ApplicationActivationManager {45BA127D-10A8-46EA-8AB7-56EA9078943C}
!define IApplicationActivationManager {2e941141-7f97-4756-ba1d-9decde894a3d}

System::Call 'OLE32::CoCreateInstance(g "${CLSID_ApplicationActivationManager}",i0,i${CLSCTX_LOCAL_SERVER},g "${IApplicationActivationManager}",*i.r1)i.r0'
DetailPrint HR=$0,ptr=$1
${If} $1 <> 0
    System::Call 'OLE32::CoAllowSetForegroundWindow(i$1,i0)'
    System::Call 'SHELL32::SHCreateItemFromParsingName(w "${pdffile}",i0,g "${IID_IShellItem}",*i.r2)'
    ${If} $2 <> 0
        System::Call 'SHELL32::SHCreateShellItemArrayFromShellItem(i$2,g "${IID_IShellItemArray}",*i.r3)'
        System::Call `$2->2()` ; Release
    ${If} $3 <> 0
    System::Call `$1->4(w "${ReaderAppId}",i$3,i0,*i.r4)i.r0` ; ActivateForFile
    DetailPrint HR=$0,PID=$4
    System::Call `$1->2()` ; Release
    System::Call `$3->2()` ; Release
    ${EndIf}
    ${EndIf}
${EndIf}

嘿,我发现了一个使用以下代码的解决方法:Exec'$WINDIR\explorer.exe$0\$APP\u DATA\PATH\AppData\Readme\Readme\u$LOCAL\u code.pdf'显示Adobe Acrobat 11首选启用保护模式。如果启用此选项,则无法使用ExecShell从nullsoft打开PDF。因此,我使用上面这一行作为解决方法,即piggy退出explorer.exe进程。感谢您的帮助: