Skip to content
⌘ NSIS Forum Archive

Installation successful/uninstall failed

5 posts

bybyby#

Installation successful/uninstall failed

I am using Windows 10 Pro.

Previously working setup now does not work. Installation successful but uninstall failed. I think that is after Windows 10 Creators Update.

Does anyone have an idea?
Anders#
No, we have no idea and you provided so little information so there is no point for me to try to guess.
bybyby#
Uninstall section...


SilentUnInstall silent
Section "Uninstall"
SetDetailsPrint textonly
DetailPrint "Türkçe Yama kaldırılıyor..."
SetDetailsPrint none
Banner::show "$\n${OYUNADI} Türkçe Yama kaldırılırken lütfen bekleyin."
ReadRegStr $INSTDIR HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${REG}" "Home"
SetShellVarContext all
Delete "$SMPROGRAMS\${OYUNADI} Türkçe\${OYUNADI} Türkçe Yama Kaldır.lnk"
Delete "$SMPROGRAMS\${OYUNADI} Türkçe\${OYUNADI}.url"
Delete "$SMPROGRAMS\${OYUNADI} Türkçe\Oku.lnk"
${un.DirState} "$SMPROGRAMS\${OYUNADI} Türkçe\" $R0
StrCmp $R0 "0" 0 +2
RMDir "$SMPROGRAMS\${OYUNADI} Türkçe"
${un.DirState} "$SMPROGRAMS\${OYUNADI} Türkçe" $R0
StrCmp $R0 "0" 0 +2
RMDir "$SMPROGRAMS\${OYUNADI} Türkçe"
SetShellVarContext current


Delete "$INSTDIR\DataPC.forge"
Rename "$INSTDIR\DataPC.forge.bkp" "$INSTDIR\DataPC.forge"

Delete "$INSTDIR\dlc_20\DataPC_20_dlc.forge"
Rename "$INSTDIR\dlc_20\DataPC_20_dlc.forge.bkp" "$INSTDIR\dlc_20\DataPC_20_dlc.forge"


DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${REG}"
Delete "$INSTDIR\oku.exe"
Delete "$INSTDIR\${OYUNADI} Türkçe Yama Kaldır.exe"
RMDir /r "$PROGRAMFILES\${OYUNADI} Türkçe"

Banner::destroy
MessageBox MB_ICONINFORMATION "${OYUNADI} Türkçe Yama bilgisayarınızdan başarıyla kaldırıldı!"
SectionEnd

Function .onGUIEnd
Delay::Free
NotifyIcon::Icon "r"
AnimGif::stop
FunctionEnd

Function OnUserAbort
Delay::Free
NotifyIcon::Icon "r"
AnimGif::stop
FunctionEnd
Anders#
And does not work means what exactly? Is it able to delete anything at all? And you don't normally have to read $InstDir from the registry...
bybyby#
Problem solved. Working codes;


SilentUnInstall silent

Section "Uninstall"
ClearErrors
${If} ${RunningX64} # if windows x64
SetRegView 64
ReadRegStr $R0 HKLM ${GAMEREG}
${Else}
SetRegView 32
ReadRegStr $R0 HKLM ${GAMEREG}
${EndIf}

SetDetailsPrint textonly

DetailPrint "Türkçe Yama kaldırılıyor..."

SetDetailsPrint none

Banner::show "$\n${OYUNADI} Türkçe Yama kaldırılırken lütfen bekleyin."

ReadRegStr $INSTDIR HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${REG}" "Home"

SetShellVarContext all

Delete "$SMPROGRAMS\${OYUNADI} Türkçe\${OYUNADI} Türkçe Yama Kaldır.lnk"

Delete "$SMPROGRAMS\${OYUNADI} Türkçe\${OYUNADI}.url"

Delete "$SMPROGRAMS\${OYUNADI} Türkçe\Oku.lnk"

${un.DirState} "$SMPROGRAMS\${OYUNADI} Türkçe\" $R0

StrCmp $R0 "0" 0 +2

RMDir "$SMPROGRAMS\${OYUNADI} Türkçe"

${un.DirState} "$SMPROGRAMS\${OYUNADI} Türkçe" $R0

StrCmp $R0 "0" 0 +2

RMDir "$SMPROGRAMS\${OYUNADI} Türkçe"

SetShellVarContext current





Delete "$INSTDIR\DataPC.forge"

Rename "$INSTDIR\DataPC.forge.bkp" "$INSTDIR\DataPC.forge"



Delete "$INSTDIR\dlc_20\DataPC_20_dlc.forge"

Rename "$INSTDIR\dlc_20\DataPC_20_dlc.forge.bkp" "$INSTDIR\dlc_20\DataPC_20_dlc.forge"





DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${REG}"

Delete "$INSTDIR\oku.exe"

Delete "$INSTDIR\${OYUNADI} Türkçe Yama Kaldır.exe"

RMDir /r "$PROGRAMFILES\${OYUNADI} Türkçe"



Banner::destroy

MessageBox MB_ICONINFORMATION "${OYUNADI} Türkçe Yama bilgisayarınızdan başarıyla kaldırıldı!"

SectionEnd



Function .onGUIEnd

Delay::Free

NotifyIcon::Icon "r"

AnimGif::stop

FunctionEnd



Function OnUserAbort

Delay::Free

NotifyIcon::Icon "r"

AnimGif::stop

FunctionEnd