Use killproc.exe instead in nsi
This commit is contained in:
36
dist/windows/strawberry.nsi.in
vendored
36
dist/windows/strawberry.nsi.in
vendored
@@ -68,13 +68,12 @@ SetCompressor /SOLID lzma
|
|||||||
!include "MUI2.nsh"
|
!include "MUI2.nsh"
|
||||||
!include "FileAssociation.nsh"
|
!include "FileAssociation.nsh"
|
||||||
!include "Capabilities.nsh"
|
!include "Capabilities.nsh"
|
||||||
|
!include LogicLib.nsh
|
||||||
|
!include x64.nsh
|
||||||
|
|
||||||
!define MUI_ICON "strawberry.ico"
|
!define MUI_ICON "strawberry.ico"
|
||||||
|
|
||||||
!define MUI_COMPONENTSPAGE_SMALLDESC
|
!define MUI_COMPONENTSPAGE_SMALLDESC
|
||||||
!define MUI_FINISHPAGE_RUN
|
|
||||||
!define MUI_FINISHPAGE_RUN_TEXT "Run Strawberry"
|
|
||||||
!define MUI_FINISHPAGE_RUN_FUNCTION "RunStrawberry"
|
|
||||||
|
|
||||||
; Installer pages
|
; Installer pages
|
||||||
!insertmacro MUI_PAGE_WELCOME
|
!insertmacro MUI_PAGE_WELCOME
|
||||||
@@ -144,16 +143,14 @@ Function .onInit
|
|||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function RunStrawberry
|
|
||||||
ShellExecAsUser::ShellExecAsUser "" "$INSTDIR/strawberry.exe" ""
|
|
||||||
FunctionEnd
|
|
||||||
|
|
||||||
Section "Delete old files" oldfiles
|
Section "Delete old files" oldfiles
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section "Strawberry" Strawberry
|
Section "Strawberry" Strawberry
|
||||||
SetOutPath "$INSTDIR"
|
SetOutPath "$INSTDIR"
|
||||||
|
|
||||||
|
nsExec::Exec '"$INSTDIR\killproc.exe" strawberry.exe'
|
||||||
|
|
||||||
File "strawberry.exe"
|
File "strawberry.exe"
|
||||||
File "strawberry-tagreader.exe"
|
File "strawberry-tagreader.exe"
|
||||||
File "strawberry.ico"
|
File "strawberry.ico"
|
||||||
@@ -243,6 +240,8 @@ Section "Strawberry" Strawberry
|
|||||||
File "libxine-2.dll"
|
File "libxine-2.dll"
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
File "killproc.exe"
|
||||||
|
|
||||||
; Register Strawberry with Default Programs
|
; Register Strawberry with Default Programs
|
||||||
Var /GLOBAL AppIcon
|
Var /GLOBAL AppIcon
|
||||||
Var /GLOBAL AppExe
|
Var /GLOBAL AppExe
|
||||||
@@ -406,28 +405,8 @@ Section "Uninstaller"
|
|||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section "Uninstall"
|
Section "Uninstall"
|
||||||
; Kill strawberry.exe if it's running
|
|
||||||
; This calling convention is retarded...
|
|
||||||
StrCpy $0 "strawberry.exe"
|
|
||||||
KillProc::FindProcesses
|
|
||||||
StrCmp $1 "-1" wooops
|
|
||||||
|
|
||||||
StrCmp $0 "0" completed
|
nsExec::Exec '"$INSTDIR\killproc.exe" strawberry.exe'
|
||||||
|
|
||||||
DetailPrint "Killing running strawberry.exe..."
|
|
||||||
|
|
||||||
StrCpy $0 "strawberry.exe"
|
|
||||||
KillProc::KillProcesses
|
|
||||||
StrCmp $1 "-1" wooops
|
|
||||||
|
|
||||||
Sleep 2000
|
|
||||||
Goto completed
|
|
||||||
|
|
||||||
wooops:
|
|
||||||
DetailPrint "-> Error: Something went wrong while killing running strawberry.exe"
|
|
||||||
Abort
|
|
||||||
|
|
||||||
completed:
|
|
||||||
|
|
||||||
; Delete all the files
|
; Delete all the files
|
||||||
|
|
||||||
@@ -602,6 +581,7 @@ Section "Uninstall"
|
|||||||
Delete "$INSTDIR\xine-plugins\xineplug_post_visualizations.dll"
|
Delete "$INSTDIR\xine-plugins\xineplug_post_visualizations.dll"
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
Delete "$INSTDIR\killproc.exe"
|
||||||
Delete "$INSTDIR\Uninstall.exe"
|
Delete "$INSTDIR\Uninstall.exe"
|
||||||
|
|
||||||
; Remove the installation folders.
|
; Remove the installation folders.
|
||||||
|
|||||||
Reference in New Issue
Block a user