Why my install is blocked by svchost.exe
Hello. Why my setup exe is blocked by svchost.exe (I know it from LockHunter
which cannot unlock) after finished instaling. When I change OutFile line in
script below and add some text before filename because old name is locked and
cannot be overwritten I can delete setup file. Old setup can be deleted only
after reboot. I turned off KAV 2010 anti virus but it do not help. I'm using
NSIS 2.46 under Windows 7 (64 bit) with SP 1 and I have UAC turned off.
Please help me. The sctipy is below. And sorry for my bad English.
!define FILESSOURCEPATH "D:\UPLOAD\WINUAE\"
Section
SetOutPath "$INSTDIR\HARD_DISKS"
File /r "${FILESSOURCEPATH}HARD_DISKS\Demos"
File /r "${FILESSOURCEPATH}HARD_DISKS\HD-Games"
SectionEnd
!define APPDIR "WINUAE_WITH_TINY_LAUNCHER"
!define APPEXE "winuae_tl.exe"
!define APPNAME "WinUAE + Tiny Launcher + Demos + Games"
!define SETUPEXE "tl_games_and_demos_setup.exe"
!define WINUAEREGKEY "Software\_Tiny_Launcher_WinUAE"
!define TLCONFIGFILE "CONFIGURATIONS\!_tl.winuae"
!define MUI_WELCOMEPAGE_TITLE_3LINES
!include "MUI.nsh"
!include "nsDialogs.nsh"
Var DIALOG
Var MESSAGE
; The name of the installer
Name "${APPNAME}"
; The output file to write
OutFile D:\${SETUPEXE}
; The default installation directory
InstallDir $PROGRAMFILES\${APPDIR}
; Request application privileges for Windows Vista
RequestExecutionLevel user
;--------------------------------
; Pages
!insertmacro MUI_PAGE_WELCOME
; Custom page
Page custom AboutSetupContent
; Installer pages
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "Launch WinUAE + Tiny Launcher"
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchApp"
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
; own custom page
Function AboutSetupContent
nsDialogs::Create 1018
Pop $DIALOG
!insertmacro MUI_HEADER_TEXT "About $(^NameDA) package." "This setup and its contents was prepared by olesio."
nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 30 500 300 "\
Following package contains WinUAE - Amiga Emulator for Windows in a little\
bit changed version and special configuration file. Also it contain\
Kickstart 3.1 ROM Image and hard disk file (*.hdf) with Tiny Launcher\
written by user called GIBS from EAB (http://eab.abime.net). I also\
included: Demoscene productions and popular games. Both in WHDLoad\
versions. This package license is no warranty. WARNING! One very\
important thing: you MUST own legal registered WHDLoad key and\
copyrighted Amiga Kickstart ROM version 3.1 file to use this setup!\
Enjoy and please visit TheCompany World Wide Web Page at:\
http://thecompany.pl for many Amiga Games as easy to use executables."
Pop $MESSAGE
nsDialogs::Show
FunctionEnd
Function LaunchApp
ExecShell "" "$INSTDIR\${APPEXE}"
FunctionEnd
; The stuff to install
Section "Required files" Section1
SectionIn RO
; Put files there
SetOverwrite on
SetOutPath "$INSTDIR\CONFIGURATIONS"
File "${FILESSOURCEPATH}${TLCONFIGFILE}"
SetOutPath "$INSTDIR\ROMS"
File "${FILESSOURCEPATH}ROMS\kick31.rom"
SetOutPath "$INSTDIR\HARD_DISKS"
File "${FILESSOURCEPATH}HARD_DISKS\4_tiny_launcher.hdf"
SetOutPath $INSTDIR
File "${FILESSOURCEPATH}${APPEXE}"
; Write WinUAE paths
WriteRegStr HKCU "${WINUAEREGKEY}\DetectedROMs" "ROM_015" 'KS ROM v3.1 (A1200) rev 40.68 (512k) [391773-01/391774-01] / "$INSTDIR\ROMS\kick31.rom"'
WriteRegStr HKCU "${WINUAEREGKEY}" "KickstartPath" "$INSTDIR\Roms\"
WriteRegStr HKCU "${WINUAEREGKEY}" "hdfPath" "$INSTDIR\HARD_DISKS\"
WriteRegStr HKCU "${WINUAEREGKEY}" "ConfigurationPath" "$INSTDIR\Configurations\"
WriteRegStr HKCU "${WINUAEREGKEY}" "ScreenshotPath" "$INSTDIR\Screenshots\"
WriteRegStr HKCU "${WINUAEREGKEY}" "StatefilePath" "$INSTDIR\Savestates\"
WriteRegStr HKCU "${WINUAEREGKEY}" "SaveimagePath" "$INSTDIR\SaveImages\"
WriteRegStr HKCU "${WINUAEREGKEY}" "VideoPath" "$INSTDIR\"
WriteRegStr HKCU "${WINUAEREGKEY}" "InputPath" "$INSTDIR\Inputrecordings\"
WriteRegStr HKCU "${WINUAEREGKEY}" "RipperPath" "$INSTDIR\"
WriteRegDWORD HKCU "${WINUAEREGKEY}" "QuickStartModel" 4
WriteRegDWORD HKCU "${WINUAEREGKEY}" "ConfigurationCache" 0
WriteRegDWORD HKCU "${WINUAEREGKEY}" "QuickStartConfiguration" 1
WriteRegDWORD HKCU "${WINUAEREGKEY}" "QuickStartCompatibility" 1
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPDIR}" "DisplayName" "${APPNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPDIR}" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPDIR}" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPDIR}" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd
; Optional section (can be disabled by the user)
Section "Desktop shortcut" Section2
CreateShortCut "$DESKTOP\Run ${APPNAME}.lnk" "$INSTDIR\${APPEXE}" "" "$INSTDIR\${APPEXE}" 0
SectionEnd
Section "Start menu shortcut" Section3
CreateDirectory "$SMPROGRAMS\${APPNAME}"
CreateShortCut "$SMPROGRAMS\${APPNAME}\Run ${APPNAME}.lnk" "$INSTDIR\${APPEXE}" "-f .\${TLCONFIGFILE}" "$INSTDIR\${APPEXE}" 0
CreateShortCut "$SMPROGRAMS\${APPNAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
SectionEnd
;--------------------------------
; Descriptions
LangString DESC_Section1 ${LANG_ENGLISH} "WinUAE emulator (in changed version) and other required package files (configuration, kickstart, hdf file with TIny Launcher, Demos and Games)."
LangString DESC_Section2 ${LANG_ENGLISH} "Creates a shortcut on the Desktop."
LangString DESC_Section3 ${LANG_ENGLISH} "Creates a subdirectory with shortcuts in the Start Menu."
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)
!insertmacro MUI_DESCRIPTION_TEXT ${Section3} $(DESC_Section3)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPDIR}"
DeleteRegKey HKCU "${WINUAEREGKEY}"
; Remove files and uninstaller
RMDir /r $INSTDIR
Delete $INSTDIR\uninstall.exe
; Remove shortcuts, if any
Delete "$DESKTOP\Run ${APPNAME}.lnk"
Delete "$SMPROGRAMS\${APPNAME}\*.*"
; Remove directories used
RMDir "$SMPROGRAMS\${APPNAME}"
RMDir "$INSTDIR"
SectionEnd