make use of modern nsis libs in installer script (#345)
This commit is contained in:
parent
7a3289b1d2
commit
1ea2846f2b
|
@ -130,7 +130,7 @@ SectionEnd
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
# File association
|
# File association
|
||||||
SubSection "$(SectionAssocsName)" SectionAssocs
|
SectionGroup "$(SectionAssocsName)" SectionAssocs
|
||||||
Section "$(SectionAssocExtNameBegin) .dev $(SectionAssocExtNameEnd)"
|
Section "$(SectionAssocExtNameBegin) .dev $(SectionAssocExtNameEnd)"
|
||||||
SectionIn 1 3
|
SectionIn 1 3
|
||||||
|
|
||||||
|
@ -219,11 +219,11 @@ Section "$(SectionAssocExtNameBegin) .hpp $(SectionAssocExtNameEnd)"
|
||||||
${NotifyShell_AssocChanged}
|
${NotifyShell_AssocChanged}
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
SubSectionEnd
|
SectionGroupEnd
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
# Shortcuts
|
# Shortcuts
|
||||||
SubSection "$(SectionShortcutsName)" SectionShortcuts
|
SectionGroup "$(SectionShortcutsName)" SectionShortcuts
|
||||||
|
|
||||||
Section "$(SectionMenuLaunchName)" SectionMenuLaunch
|
Section "$(SectionMenuLaunchName)" SectionMenuLaunch
|
||||||
SectionIn 1 3
|
SectionIn 1 3
|
||||||
|
@ -241,7 +241,7 @@ Section "$(SectionDesktopLaunchName)" SectionDesktopLaunch
|
||||||
CreateShortCut "$DESKTOP\$(MessageAppName).lnk" "$INSTDIR\RedPandaIDE.exe"
|
CreateShortCut "$DESKTOP\$(MessageAppName).lnk" "$INSTDIR\RedPandaIDE.exe"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
SubSectionEnd
|
SectionGroupEnd
|
||||||
|
|
||||||
Section "$(SectionCompressName)" SectionCompress
|
Section "$(SectionCompressName)" SectionCompress
|
||||||
DetailPrint "$(MessageCompressing)"
|
DetailPrint "$(MessageCompressing)"
|
||||||
|
@ -328,77 +328,27 @@ Function un.onInit
|
||||||
!endif
|
!endif
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
;http://nsis.sourceforge.net/archive/viewpage.php?pageid=202
|
Var /GLOBAL uninstallString
|
||||||
;After changing file associations, you can call this macro to refresh the shell immediatly.
|
Var /GLOBAL installLocation
|
||||||
;It calls the shell32 function SHChangeNotify. This will force windows to reload your changes from the registry.
|
|
||||||
!define SHCNE_ASSOCCHANGED 0x08000000
|
|
||||||
!define SHCNF_IDLIST 0
|
|
||||||
|
|
||||||
Function un.DeleteDirIfEmpty
|
|
||||||
FindFirst $R0 $R1 "$0\*.*"
|
|
||||||
strcmp $R1 "." 0 NoDelete
|
|
||||||
FindNext $R0 $R1
|
|
||||||
strcmp $R1 ".." 0 NoDelete
|
|
||||||
ClearErrors
|
|
||||||
FindNext $R0 $R1
|
|
||||||
IfErrors 0 NoDelete
|
|
||||||
FindClose $R0
|
|
||||||
Sleep 1000
|
|
||||||
RMDir "$0"
|
|
||||||
NoDelete:
|
|
||||||
FindClose $R0
|
|
||||||
FunctionEnd
|
|
||||||
|
|
||||||
Function GetParent
|
|
||||||
|
|
||||||
Exch $R0
|
|
||||||
Push $R1
|
|
||||||
Push $R2
|
|
||||||
Push $R3
|
|
||||||
|
|
||||||
StrCpy $R1 0
|
|
||||||
StrLen $R2 $R0
|
|
||||||
|
|
||||||
loop:
|
|
||||||
IntOp $R1 $R1 + 1
|
|
||||||
IntCmp $R1 $R2 get 0 get
|
|
||||||
StrCpy $R3 $R0 1 -$R1
|
|
||||||
StrCmp $R3 "\" get
|
|
||||||
Goto loop
|
|
||||||
|
|
||||||
get:
|
|
||||||
StrCpy $R0 $R0 -$R1
|
|
||||||
|
|
||||||
Pop $R3
|
|
||||||
Pop $R2
|
|
||||||
Pop $R1
|
|
||||||
Exch $R0
|
|
||||||
|
|
||||||
FunctionEnd
|
|
||||||
|
|
||||||
Function UninstallExisting
|
Function UninstallExisting
|
||||||
ReadRegStr $R0 ShCtx "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++" "UninstallString"
|
ReadRegStr $uninstallString ShCtx "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++" "UninstallString"
|
||||||
|
${If} $uninstallString != ""
|
||||||
StrCmp $R0 "" done
|
GetFullPathName $installLocation "$uninstallString\.." ; remove '\uninstall.exe'
|
||||||
|
|
||||||
Push $R0
|
|
||||||
Call GetParent
|
|
||||||
Pop $R1
|
|
||||||
|
|
||||||
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
|
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
|
||||||
"$(MessageUninstallExisting)" \
|
"$(MessageUninstallExisting)" \
|
||||||
IDOK uninst
|
/SD IDNO \
|
||||||
|
IDOK uninst
|
||||||
Abort
|
Abort
|
||||||
|
uninst:
|
||||||
;Run the uninstaller
|
ClearErrors
|
||||||
uninst:
|
HideWindow
|
||||||
ClearErrors
|
ClearErrors
|
||||||
HideWindow
|
ExecWait '"$uninstallString" _?=$installLocation'
|
||||||
ClearErrors
|
Delete "$uninstallString"
|
||||||
ExecWait '"$R0" _?=$R1'
|
RMDir "$installLocation"
|
||||||
BringToFront
|
BringToFront
|
||||||
|
${EndIf}
|
||||||
done:
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
|
@ -446,8 +396,7 @@ Section "Uninstall"
|
||||||
RMDir /r "$INSTDIR\mingw32"
|
RMDir /r "$INSTDIR\mingw32"
|
||||||
RMDir /r "$INSTDIR\mingw64"
|
RMDir /r "$INSTDIR\mingw64"
|
||||||
|
|
||||||
StrCpy $0 "$INSTDIR"
|
RMDir "$INSTDIR"
|
||||||
Call un.DeleteDirIfEmpty
|
|
||||||
|
|
||||||
; Remove registry keys
|
; Remove registry keys
|
||||||
DeleteRegKey ShCtx "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++"
|
DeleteRegKey ShCtx "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++"
|
||||||
|
|
Loading…
Reference in New Issue