Google chrome extension 安装Chrome扩展的NSIS脚本杀死Outlook

Google chrome extension 安装Chrome扩展的NSIS脚本杀死Outlook,google-chrome-extension,nsis,Google Chrome Extension,Nsis,这是一个非常奇怪的错误 下面是一个NSIS脚本,它在Google Chrome中安装了一个扩展。奇怪的是,如果在Outlook 2007运行时在Windows 7上运行此操作,则会导致Outlook关闭。错误显示为“Outlook停止响应”,然后在关闭前旋转一分钟 有人能解释一下原因是什么以及如何解决它吗 !define VERSION "1.0.0" !define EXT_ID "kmffervcdaycdjlksmflkjghksdf" !define INSTALL_DIR "$LOC

这是一个非常奇怪的错误

下面是一个NSIS脚本,它在Google Chrome中安装了一个扩展。奇怪的是,如果在Outlook 2007运行时在Windows 7上运行此操作,则会导致Outlook关闭。错误显示为“Outlook停止响应”,然后在关闭前旋转一分钟

有人能解释一下原因是什么以及如何解决它吗

!define VERSION "1.0.0" 
!define EXT_ID "kmffervcdaycdjlksmflkjghksdf"
!define INSTALL_DIR "$LOCALAPPDATA\Google\Chrome\User Data\Default\Extensions\${EXT_ID}\${VERSION}_0"
!define P_FILE "$LOCALAPPDATA\Google\Chrome\User Data\Default\Preferences"

!include "ZipDLL.nsh" 

!include "TextFunc.nsh"
!insertmacro LineFind

!include "WordFunc.nsh"
!insertmacro WordFind


Name "Chrome Extension Installer"
OutFile "extension_installer.exe"
RequestExecutionLevel admin

Var PMEMORY
Var SIZE

Function .onInit
    SetSilent silent
FunctionEnd

Section
    SetOutPath $TEMP 
    File "extension.crx" 
    File "chrome_preferences.txt"

    CreateDirectory "${INSTALL_DIR}"
    ZipDLL::extractall "$TEMP\extension.crx" "${INSTALL_DIR}"

    StrCpy $0 "${P_FILE}"
    StrCpy $1 "${P_FILE}"
    StrCpy $R0 '"settings": {'
    StrCpy $R1 "$TEMP\chrome_preferences.txt"
    StrCpy $R2 "0"
    StrCpy $R3 "0"
    ${LineFind} "$0" "$1" "1:-2 -1" "LineFindCallback"
SectionEnd


Function LineFindCallback
    StrCmp $PMEMORY '0' end

    begin:
    ${WordFind} "$R9" "$R0" "E+1{" $1
    IfErrors freemem
    FileWrite $R4 "$1"

    StrCmp $PMEMORY '' 0 write
    FileOpen $1 $R1 a
    FileSeek $1 0 END $SIZE
    System::Alloc $SIZE
    Pop $PMEMORY
    FileSeek $1 0 SET
    System::Call 'kernel32::ReadFile(i r1, i $PMEMORY, i $SIZE, t.,)'
    FileClose $1

    write:
    IntOp $R3 $R3 + 1
    System::Call 'kernel32::WriteFile(i R4, i $PMEMORY, i $SIZE, t.,)'
    ${WordFind} "$R9" "$R0" "+1}" $R9
    StrCmp $R3 $R2 0 begin

    freemem:
    StrCmp $PMEMORY '' end
    StrCmp $R7 -1 +2
    StrCmp $R3 $R2 0 end
    System::Free $PMEMORY
    StrCpy $PMEMORY 0

    end:
    Push $0
FunctionEnd

我不知道这是否是问题所在,但您对写入/读取文件的系统调用是错误的,请尝试…(I r?、I$PMEMORY、I$SIZE、*I、I 0)

问题原来是Zipdl。我们现在不再使用ZipDLL,而是使用解压文件层次结构,问题就消失了


(Anders所做的评论似乎都是有效的,但没有一个真正确定问题的原因。)

如果您总是想强制静默安装,可以使用SilentInstall属性,而不需要。onInit…将RequestExecutionLevel admin与$LOCALAPPDATA混合使用是不合适的,当非管理员用户与管理员组成员中的其他用户升级时,您将得到错误的$LOCALAPPDATA!你能分享这个完整的脚本吗?是的,第三方插件崩溃可能是我的第二猜测,但将无效数据传递到system.dll更可能导致随机问题。你应该报告你的问题@