小编Ped*_*ira的帖子

NSIS卸载程序不会删除文件/文件夹

我正在为我工​​作的公司内部使用的其中一个应用程序编写NSIS安装程序,安装过程正常,没有创建所有REG密钥的问题,应用程序使用的文件文件夹和服务也是如此.由于某些原因我无法理解,卸载过程不起作用.

应用程序创建的服务被删除,注册表项,最简单的部分,文件本身,我无法通过卸载程序删除它们!

#Includes
!include "x64.nsh"
#Defines and Installer Properties
Outfile "ESTvnc Installer.exe"
Name ESTvnc 
Icon "${NSISDIR}\contrib\graphics\icons\VNCON.ico"
#Detect OS Version
Function .onInit
    StrCpy $instdir $PROGRAMFILES
    ${If} ${RunningX64}
        StrCpy $instdir $PROGRAMFILES32
    ${EndIf}
FunctionEnd

section
    SetShellVarContext all  
    CreateDirectory $instdir\EST\ESTvnc
    setOutPath $instdir\EST\ESTvnc
    File /r installfiles\*
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ESTvnc\" \
                 "DisplayName" "ESTvnc"
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ESTvnc"\
                 "UninstallString" "$instdir\EST\ESTvnc\uninstaller.exe"
    writeUninstaller $instdir\EST\ESTvnc\uninstaller.exe
    ExecWait '"$instdir\EST\estvnc\estvnc.exe" -install'
sectionEnd

section "Uninstall"
    SetShellVarContext all  
    SimpleSC::StopService "ESTVNC" 1 30
    pop $0
    SimpleSC::StopService "ESTVNCSR" 1 30
    pop $0
    SimpleSC::RemoveService "ESTVNC"
    SimpleSC::RemoveService "ESTVNCSR"    
    RMDir /r …
Run Code Online (Sandbox Code Playgroud)

nsis delete-file

2
推荐指数
1
解决办法
3214
查看次数

标签 统计

delete-file ×1

nsis ×1