2024-03-30 13:19:31 +08:00
|
|
|
####################################################################
|
2021-11-05 10:44:23 +08:00
|
|
|
# Startup
|
2024-03-25 11:29:56 +08:00
|
|
|
SetFont "Segoe UI" 11
|
2022-12-08 12:45:35 +08:00
|
|
|
Unicode True
|
2024-03-30 13:19:31 +08:00
|
|
|
|
|
|
|
!define APP_NAME_EN "Red Panda C++"
|
|
|
|
!define APP_NAME_ZH_CN "小熊猫 C++"
|
|
|
|
!define DISPLAY_NAME "$(StrAppName) ${APP_VERSION} (${ARCH})"
|
2021-11-05 10:44:23 +08:00
|
|
|
|
2024-03-30 17:53:42 +08:00
|
|
|
!define INSTALL_NAME "RedPanda-Cpp"
|
2024-03-30 10:35:45 +08:00
|
|
|
!define REGISTRY_PROGRAM_ID "RedPanda-C++"
|
|
|
|
!define UNINSTKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${REGISTRY_PROGRAM_ID}"
|
|
|
|
|
2024-03-30 17:53:42 +08:00
|
|
|
!define MULTIUSER_EXECUTIONLEVEL Highest
|
|
|
|
!define MULTIUSER_INSTALLMODE_COMMANDLINE
|
|
|
|
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${UNINSTKEY}"
|
|
|
|
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "CurrentUser"
|
|
|
|
!define MULTIUSER_INSTALLMODE_INSTDIR "${INSTALL_NAME}"
|
|
|
|
!define MULTIUSER_MUI
|
|
|
|
!if "${ARCH}" != "x86"
|
|
|
|
!define MULTIUSER_USE_PROGRAMFILES64
|
|
|
|
!endif
|
|
|
|
|
2024-03-29 19:14:30 +08:00
|
|
|
!include "Integration.nsh"
|
2024-03-29 12:50:45 +08:00
|
|
|
!include "LogicLib.nsh"
|
2021-11-05 10:44:23 +08:00
|
|
|
!include "MUI2.nsh"
|
2024-03-30 17:53:42 +08:00
|
|
|
!include "MultiUser.nsh"
|
2024-03-29 12:50:45 +08:00
|
|
|
!include "WinVer.nsh"
|
2024-03-30 10:35:45 +08:00
|
|
|
!include "WordFunc.nsh"
|
2024-03-29 12:50:45 +08:00
|
|
|
!include "x64.nsh"
|
|
|
|
|
2021-11-05 10:44:23 +08:00
|
|
|
!include "lang.nsh"
|
2024-03-29 12:50:45 +08:00
|
|
|
!include "utils.nsh"
|
2021-11-05 10:44:23 +08:00
|
|
|
|
|
|
|
!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
# Installer Attributes
|
|
|
|
|
|
|
|
Name "${DISPLAY_NAME}"
|
|
|
|
OutFile "${FINALNAME}"
|
|
|
|
Caption "${DISPLAY_NAME}"
|
|
|
|
|
|
|
|
LicenseData "LICENSE"
|
2024-03-30 17:53:42 +08:00
|
|
|
|
2021-11-05 10:44:23 +08:00
|
|
|
####################################################################
|
|
|
|
# Interface Settings
|
|
|
|
|
|
|
|
ShowInstDetails show
|
|
|
|
AutoCloseWindow false
|
|
|
|
SilentInstall normal
|
|
|
|
CRCCheck on
|
|
|
|
SetCompressor /SOLID /FINAL lzma
|
|
|
|
SetCompressorDictSize 64
|
|
|
|
SetDatablockOptimize on
|
|
|
|
SetOverwrite try
|
|
|
|
XPStyle on
|
|
|
|
|
2024-03-07 11:06:15 +08:00
|
|
|
ManifestDPIAware true
|
|
|
|
|
2024-03-30 13:19:31 +08:00
|
|
|
InstType "$(StrInstTypeFull)" ;1
|
|
|
|
InstType "$(StrInstTypeMinimal)" ;2
|
|
|
|
InstType "$(StrInstTypeSafe)" ;3
|
2021-11-05 10:44:23 +08:00
|
|
|
|
|
|
|
####################################################################
|
|
|
|
# Pages
|
|
|
|
|
|
|
|
!define MUI_ICON "devcpp.ico"
|
|
|
|
!define MUI_UNICON "devcpp.ico"
|
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
!define MUI_LANGDLL_ALLLANGUAGES
|
|
|
|
!define MUI_FINISHPAGE_RUN "$INSTDIR\RedPandaIDE.exe"
|
|
|
|
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
|
|
|
|
!define MUI_COMPONENTSPAGE_SMALLDESC
|
|
|
|
|
|
|
|
!insertmacro MUI_PAGE_LICENSE "LICENSE"
|
2024-03-30 17:53:42 +08:00
|
|
|
!insertmacro MULTIUSER_PAGE_INSTALLMODE
|
2021-11-05 10:44:23 +08:00
|
|
|
!insertmacro MUI_PAGE_COMPONENTS
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
!insertmacro MUI_PAGE_FINISH
|
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
# Languages
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
!insertmacro MUI_LANGUAGE "SimpChinese"
|
|
|
|
|
2024-03-30 10:35:45 +08:00
|
|
|
####################################################################
|
|
|
|
# Silently uninstall previous version
|
|
|
|
|
|
|
|
Section "" SecUninstallPrevious
|
|
|
|
!insertmacro CheckPreviousInstaller
|
|
|
|
SectionEnd
|
|
|
|
|
2021-11-05 10:44:23 +08:00
|
|
|
####################################################################
|
|
|
|
# Files, by option section
|
|
|
|
|
|
|
|
Section "$(SectionMainName)" SectionMain
|
|
|
|
SectionIn 1 2 3 RO
|
|
|
|
|
|
|
|
SetOutPath $INSTDIR
|
|
|
|
|
|
|
|
; Allways create an uninstaller
|
|
|
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
2024-03-30 13:19:31 +08:00
|
|
|
WriteRegStr ShCtx "${UNINSTKEY}" "DisplayName" "$(StrAppName) (${ARCH})"
|
2024-03-30 10:35:45 +08:00
|
|
|
WriteRegStr ShCtx "${UNINSTKEY}" "InstallLocation" "$INSTDIR"
|
|
|
|
WriteRegStr ShCtx "${UNINSTKEY}" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
|
|
|
WriteRegStr ShCtx "${UNINSTKEY}" "QuietUninstallString" '"$INSTDIR\uninstall.exe" /S'
|
|
|
|
WriteRegStr ShCtx "${UNINSTKEY}" "DisplayVersion" "${APP_VERSION}"
|
|
|
|
WriteRegStr ShCtx "${UNINSTKEY}" "DisplayIcon" "$INSTDIR\RedPandaIDE.exe"
|
2024-03-30 13:19:31 +08:00
|
|
|
WriteRegStr ShCtx "${UNINSTKEY}" "Publisher" "Roy Qu (royqh1979@gmail.com)"
|
2024-03-30 17:53:42 +08:00
|
|
|
WriteRegStr ShCtx "${UNINSTKEY}" "$MultiUser.InstallMode" "1"
|
2021-11-05 10:44:23 +08:00
|
|
|
|
|
|
|
; Write required files
|
|
|
|
File "RedPandaIDE.exe"
|
|
|
|
File "ConsolePauser.exe"
|
2022-02-25 12:06:04 +08:00
|
|
|
File "redpanda-win-git-askpass.exe"
|
2021-11-05 10:44:23 +08:00
|
|
|
File "astyle.exe"
|
|
|
|
File "LICENSE"
|
|
|
|
File "NEWS.md"
|
|
|
|
File "README.md"
|
2023-11-19 16:41:36 +08:00
|
|
|
File "qt.conf"
|
2024-03-31 08:23:30 +08:00
|
|
|
!ifdef HAVE_OPENCONSOLE
|
|
|
|
File "OpenConsole.exe"
|
|
|
|
!endif
|
|
|
|
|
2021-11-05 10:44:23 +08:00
|
|
|
; Write required paths
|
|
|
|
SetOutPath $INSTDIR\Templates
|
|
|
|
File /nonfatal /r "Templates\*"
|
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
2024-03-29 08:22:02 +08:00
|
|
|
!ifdef HAVE_MINGW32
|
|
|
|
Section "$(SectionMinGW32Name)" SectionMinGW32
|
2024-03-28 17:46:39 +08:00
|
|
|
SectionIn 1 3
|
2024-03-29 08:22:02 +08:00
|
|
|
SetOutPath $INSTDIR
|
2021-11-05 10:44:23 +08:00
|
|
|
|
2024-03-29 08:22:02 +08:00
|
|
|
File /nonfatal /r "mingw32"
|
|
|
|
SectionEnd
|
|
|
|
!endif
|
|
|
|
|
|
|
|
!ifdef HAVE_MINGW64
|
|
|
|
Section "$(SectionMinGW64Name)" SectionMinGW64
|
|
|
|
SectionIn 1 3
|
|
|
|
SetOutPath $INSTDIR
|
|
|
|
|
|
|
|
File /nonfatal /r "mingw64"
|
2024-03-28 17:46:39 +08:00
|
|
|
SectionEnd
|
|
|
|
!endif
|
2021-11-05 10:44:23 +08:00
|
|
|
|
2024-03-31 08:23:30 +08:00
|
|
|
!ifdef HAVE_LLVM
|
|
|
|
Section "$(SectionLlvmName)" SectionLlvm
|
|
|
|
SectionIn 1 3
|
|
|
|
SetOutPath $INSTDIR
|
|
|
|
|
|
|
|
File /nonfatal /r "llvm-mingw"
|
|
|
|
SectionEnd
|
|
|
|
!endif
|
|
|
|
|
2021-11-05 10:44:23 +08:00
|
|
|
####################################################################
|
|
|
|
# File association
|
2024-03-30 00:00:56 +08:00
|
|
|
SectionGroup "$(SectionAssocsName)" SectionAssocs
|
2021-11-05 10:44:23 +08:00
|
|
|
Section "$(SectionAssocExtNameBegin) .dev $(SectionAssocExtNameEnd)"
|
|
|
|
SectionIn 1 3
|
|
|
|
|
|
|
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
2024-03-30 17:53:42 +08:00
|
|
|
WriteRegStr ShCtx "Software\Classes\.dev" "" "DevCpp.dev"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.dev" "" "$(StrAppName) $(StrProjectFile)"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.dev\DefaultIcon" "" '$0,3'
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.dev\Shell\Open\Command" "" '$0 "%1"'
|
2024-03-29 19:14:30 +08:00
|
|
|
${NotifyShell_AssocChanged}
|
2021-11-05 10:44:23 +08:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section "$(SectionAssocExtNameBegin) .c $(SectionAssocExtNameEnd)"
|
|
|
|
SectionIn 1 3
|
|
|
|
|
|
|
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
2024-03-30 17:53:42 +08:00
|
|
|
WriteRegStr ShCtx "Software\Classes\.c" "" "DevCpp.c"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.c" "" "C $(StrSourceFile)"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.c\DefaultIcon" "" '$0,4'
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.c\Shell\Open\Command" "" '$0 "%1"'
|
2024-03-29 19:14:30 +08:00
|
|
|
${NotifyShell_AssocChanged}
|
2021-11-05 10:44:23 +08:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section "$(SectionAssocExtNameBegin) .cpp $(SectionAssocExtNameEnd)"
|
|
|
|
SectionIn 1 3
|
|
|
|
|
|
|
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
2024-03-30 17:53:42 +08:00
|
|
|
WriteRegStr ShCtx "Software\Classes\.cpp" "" "DevCpp.cpp"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.cpp" "" "C++ $(StrSourceFile)"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.cpp\DefaultIcon" "" '$0,5'
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.cpp\Shell\Open\Command" "" '$0 "%1"'
|
2024-03-29 19:14:30 +08:00
|
|
|
${NotifyShell_AssocChanged}
|
2021-11-05 10:44:23 +08:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section "$(SectionAssocExtNameBegin) .cxx $(SectionAssocExtNameEnd)"
|
|
|
|
SectionIn 1 3
|
|
|
|
|
|
|
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
2024-03-30 17:53:42 +08:00
|
|
|
WriteRegStr ShCtx "Software\Classes\.cxx" "" "DevCpp.cxx"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.cxx" "" "C++ $(StrSourceFile)"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.cxx\DefaultIcon" "" '$0,5'
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.cxx\Shell\Open\Command" "" '$0 "%1"'
|
2024-03-29 19:14:30 +08:00
|
|
|
${NotifyShell_AssocChanged}
|
2021-11-05 10:44:23 +08:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section "$(SectionAssocExtNameBegin) .cc $(SectionAssocExtNameEnd)"
|
|
|
|
SectionIn 1 3
|
|
|
|
|
|
|
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
2024-03-30 17:53:42 +08:00
|
|
|
WriteRegStr ShCtx "Software\Classes\.cc" "" "DevCpp.cc"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.cc" "" "C++ $(StrSourceFile)"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.cc\DefaultIcon" "" '$0,5'
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.cc\Shell\Open\Command" "" '$0 "%1"'
|
2024-03-29 19:14:30 +08:00
|
|
|
${NotifyShell_AssocChanged}
|
2021-11-05 10:44:23 +08:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section "$(SectionAssocExtNameBegin) .hxx $(SectionAssocExtNameEnd)"
|
|
|
|
SectionIn 1 3
|
|
|
|
|
|
|
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
2024-03-30 17:53:42 +08:00
|
|
|
WriteRegStr ShCtx "Software\Classes\.hxx" "" "DevCpp.hxx"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.hxx" "" "C++ $(StrHeaderFile)"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.hxx\DefaultIcon" "" '$0,7'
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.hxx\Shell\Open\Command" "" '$0 "%1"'
|
2024-03-29 19:14:30 +08:00
|
|
|
${NotifyShell_AssocChanged}
|
2021-11-05 10:44:23 +08:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section "$(SectionAssocExtNameBegin) .h $(SectionAssocExtNameEnd)"
|
|
|
|
SectionIn 1 3
|
|
|
|
|
|
|
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
2024-03-30 17:53:42 +08:00
|
|
|
WriteRegStr ShCtx "Software\Classes\.h" "" "DevCpp.h"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.h" "" "C $(StrHeaderFile)"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.h\DefaultIcon" "" '$0,6'
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.h\Shell\Open\Command" "" '$0 "%1"'
|
2024-03-29 19:14:30 +08:00
|
|
|
${NotifyShell_AssocChanged}
|
2021-11-05 10:44:23 +08:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section "$(SectionAssocExtNameBegin) .hpp $(SectionAssocExtNameEnd)"
|
|
|
|
SectionIn 1 3
|
|
|
|
|
|
|
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
2024-03-30 17:53:42 +08:00
|
|
|
WriteRegStr ShCtx "Software\Classes\.hpp" "" "DevCpp.hpp"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.hpp" "" "C++ $(StrHeaderFile)"
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.hpp\DefaultIcon" "" '$0,7'
|
|
|
|
WriteRegStr ShCtx "Software\Classes\DevCpp.hpp\Shell\Open\Command" "" '$0 "%1"'
|
2024-03-29 19:14:30 +08:00
|
|
|
${NotifyShell_AssocChanged}
|
2021-11-05 10:44:23 +08:00
|
|
|
SectionEnd
|
|
|
|
|
2024-03-30 00:00:56 +08:00
|
|
|
SectionGroupEnd
|
2021-11-05 10:44:23 +08:00
|
|
|
|
|
|
|
####################################################################
|
|
|
|
# Shortcuts
|
2024-03-30 00:00:56 +08:00
|
|
|
SectionGroup "$(SectionShortcutsName)" SectionShortcuts
|
2021-11-05 10:44:23 +08:00
|
|
|
|
|
|
|
Section "$(SectionMenuLaunchName)" SectionMenuLaunch
|
|
|
|
SectionIn 1 3
|
2024-03-28 14:54:17 +08:00
|
|
|
|
2021-11-05 10:44:23 +08:00
|
|
|
StrCpy $0 $SMPROGRAMS ; start menu Programs folder
|
2024-03-30 13:19:31 +08:00
|
|
|
CreateDirectory "$0\$(StrAppName)"
|
|
|
|
CreateShortCut "$0\$(StrAppName)\$(StrAppName).lnk" "$INSTDIR\RedPandaIDE.exe"
|
|
|
|
CreateShortCut "$0\$(StrAppName)\License.lnk" "$INSTDIR\LICENSE"
|
|
|
|
CreateShortCut "$0\$(StrAppName)\$(StrUninstallerAppName).lnk" "$INSTDIR\uninstall.exe"
|
2021-11-05 10:44:23 +08:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section "$(SectionDesktopLaunchName)" SectionDesktopLaunch
|
|
|
|
SectionIn 1 3
|
2024-03-28 14:54:17 +08:00
|
|
|
|
2024-03-30 13:19:31 +08:00
|
|
|
CreateShortCut "$DESKTOP\$(StrAppName).lnk" "$INSTDIR\RedPandaIDE.exe"
|
2021-11-05 10:44:23 +08:00
|
|
|
SectionEnd
|
|
|
|
|
2024-03-30 00:00:56 +08:00
|
|
|
SectionGroupEnd
|
2021-11-05 10:44:23 +08:00
|
|
|
|
2024-03-30 00:00:09 +08:00
|
|
|
Section "$(SectionCompressName)" SectionCompress
|
|
|
|
DetailPrint "$(MessageCompressing)"
|
|
|
|
ExecWait '$SYSDIR\compact.exe /C /S /F /EXE:XPRESS16K "$INSTDIR\*"'
|
|
|
|
SectionEnd
|
|
|
|
|
2021-11-05 10:44:23 +08:00
|
|
|
Section "$(SectionConfigName)" SectionConfig
|
|
|
|
SectionIn 3
|
|
|
|
|
2021-11-07 10:48:09 +08:00
|
|
|
RMDir /r "$APPDATA\RedPandaIDE"
|
2021-11-05 10:44:23 +08:00
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
|
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionMain} "$(MessageSectionMain)"
|
2024-03-29 08:22:02 +08:00
|
|
|
!ifdef HAVE_MINGW32
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionMinGW32} "$(MessageSectionMinGW32)"
|
|
|
|
!endif
|
|
|
|
!ifdef HAVE_MINGW64
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionMinGW64} "$(MessageSectionMinGW64)"
|
2024-03-28 17:46:39 +08:00
|
|
|
!endif
|
2024-03-31 08:23:30 +08:00
|
|
|
!ifdef HAVE_LLVM
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionLlvm} "$(MessageSectionLlvm)"
|
|
|
|
!endif
|
2021-11-05 10:44:23 +08:00
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionShortcuts} "$(MessageSectionShortcuts)"
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionAssocs} "$(MessageSectionAssocs)"
|
2024-03-30 00:00:09 +08:00
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionCompress} "$(MessageSectionCompress)"
|
2021-11-05 10:44:23 +08:00
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionConfig} "$(MessageSectionConfig)"
|
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
# Functions, utilities
|
|
|
|
|
|
|
|
Function .onInit
|
2024-03-30 17:53:42 +08:00
|
|
|
!insertmacro MULTIUSER_INIT
|
2021-11-05 10:44:23 +08:00
|
|
|
!insertmacro MUI_LANGDLL_DISPLAY
|
2024-03-29 12:50:45 +08:00
|
|
|
!insertmacro DetectOsArch
|
2021-11-05 10:44:23 +08:00
|
|
|
|
|
|
|
IfFileExists "C:\Dev-Cpp\devcpp.exe" 0 +2
|
|
|
|
SectionSetFlags ${SectionConfig} ${SF_SELECTED} # Remove old Dev-Cpp config files
|
|
|
|
|
|
|
|
IfFileExists "$APPDATA\Dev-Cpp\devcpp.cfg" 0 +2 # deprecated config file
|
|
|
|
SectionSetFlags ${SectionConfig} ${SF_SELECTED}
|
|
|
|
|
2024-03-28 14:54:17 +08:00
|
|
|
SetShellVarContext all
|
2024-03-28 17:46:39 +08:00
|
|
|
!if "${ARCH}" == "x86"
|
|
|
|
SetRegView 32
|
|
|
|
!else
|
|
|
|
SetRegView 64
|
|
|
|
!endif
|
2021-11-05 10:44:23 +08:00
|
|
|
FunctionEnd
|
|
|
|
|
2024-03-29 12:50:45 +08:00
|
|
|
Function .onSelChange
|
|
|
|
!insertmacro SectionAction_CheckMingw64
|
2024-03-30 00:00:09 +08:00
|
|
|
!insertmacro SectionAction_CheckCompress
|
2024-03-29 12:50:45 +08:00
|
|
|
FunctionEnd
|
|
|
|
|
2021-11-05 10:44:23 +08:00
|
|
|
Function myGuiInit
|
2024-03-29 12:50:45 +08:00
|
|
|
!insertmacro CheckOsArch
|
|
|
|
!insertmacro CheckOsBuild
|
2024-03-30 10:35:45 +08:00
|
|
|
!insertmacro CheckV2Installer
|
2024-03-29 12:50:45 +08:00
|
|
|
|
|
|
|
!insertmacro SectionAction_CheckMingw64
|
2024-03-30 00:00:09 +08:00
|
|
|
!insertmacro SectionAction_CheckCompress
|
2021-11-05 10:44:23 +08:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function un.onInit
|
2024-03-30 17:53:42 +08:00
|
|
|
!insertmacro MULTIUSER_UNINIT
|
2024-03-28 14:54:17 +08:00
|
|
|
!insertmacro MUI_UNGETLANGUAGE
|
|
|
|
|
|
|
|
SetShellVarContext all
|
2024-03-28 17:46:39 +08:00
|
|
|
!if "${ARCH}" == "x86"
|
|
|
|
SetRegView 32
|
|
|
|
!else
|
|
|
|
SetRegView 64
|
|
|
|
!endif
|
2021-11-05 10:44:23 +08:00
|
|
|
FunctionEnd
|
|
|
|
|
2024-03-30 00:00:56 +08:00
|
|
|
Var /GLOBAL uninstallString
|
|
|
|
Var /GLOBAL installLocation
|
2024-03-30 10:35:45 +08:00
|
|
|
Var /GLOBAL oldVersion
|
|
|
|
Var /GLOBAL versionCompareResult
|
2021-11-05 10:44:23 +08:00
|
|
|
|
2021-11-07 10:48:09 +08:00
|
|
|
Function UninstallExisting
|
2024-03-30 10:35:45 +08:00
|
|
|
ReadRegStr $uninstallString ShCtx "${UNINSTKEY}" "UninstallString"
|
2024-03-30 00:00:56 +08:00
|
|
|
${If} $uninstallString != ""
|
2024-03-30 10:35:45 +08:00
|
|
|
ReadRegStr $installLocation ShCtx "${UNINSTKEY}" "InstallLocation"
|
|
|
|
DetailPrint "$(MessageUninstallingExisting)"
|
|
|
|
; uninstallString already quoted; NSIS requires installLocation unquoted
|
|
|
|
ExecWait '$uninstallString /S _?=$installLocation'
|
2024-03-30 00:00:56 +08:00
|
|
|
Delete "$uninstallString"
|
|
|
|
RMDir "$installLocation"
|
2024-03-30 10:35:45 +08:00
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function UninstallV2
|
|
|
|
ReadRegStr $oldVersion HKLM "${UNINSTKEY}" "DisplayVersion"
|
|
|
|
${If} $oldVersion != ""
|
|
|
|
${VersionCompare} "3.0" "$oldVersion" $versionCompareResult
|
|
|
|
${If} "$versionCompareResult" == 1 ; 1st version is greater
|
|
|
|
ReadRegStr $uninstallString HKLM "${UNINSTKEY}" "UninstallString"
|
|
|
|
GetFullPathName $installLocation "$uninstallString\.." ; remove '\uninstall.exe'
|
|
|
|
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
|
|
|
|
"$(MessageUninstallV2)" \
|
|
|
|
/SD IDNO \
|
|
|
|
IDOK uninst
|
|
|
|
Abort
|
|
|
|
uninst:
|
|
|
|
ClearErrors
|
|
|
|
HideWindow
|
|
|
|
ClearErrors
|
|
|
|
ExecWait '"$uninstallString" _?=$installLocation'
|
|
|
|
Delete "$uninstallString"
|
|
|
|
RMDir "$installLocation"
|
|
|
|
BringToFront
|
|
|
|
${EndIf}
|
2024-03-30 00:00:56 +08:00
|
|
|
${EndIf}
|
2021-11-07 10:48:09 +08:00
|
|
|
FunctionEnd
|
|
|
|
|
2021-11-05 10:44:23 +08:00
|
|
|
####################################################################
|
|
|
|
# uninstall
|
|
|
|
|
|
|
|
UninstallText "$(MessageUninstallText)"
|
|
|
|
ShowUninstDetails show
|
|
|
|
|
|
|
|
Section "Uninstall"
|
|
|
|
|
|
|
|
; Remove uninstaller
|
|
|
|
Delete "$INSTDIR\uninstall.exe"
|
|
|
|
|
2024-03-28 14:54:17 +08:00
|
|
|
; Remove start menu stuff
|
2024-03-30 13:19:31 +08:00
|
|
|
RMDir /r "$SMPROGRAMS\${APP_NAME_EN}"
|
|
|
|
RMDir /r "$SMPROGRAMS\${APP_NAME_ZH_CN}"
|
2024-03-28 14:54:17 +08:00
|
|
|
|
|
|
|
; Remove desktop stuff
|
2024-03-30 13:19:31 +08:00
|
|
|
Delete "$QUICKLAUNCH\${APP_NAME_EN}.lnk"
|
|
|
|
Delete "$QUICKLAUNCH\${APP_NAME_ZH_CN}.lnk"
|
|
|
|
Delete "$DESKTOP\${APP_NAME_EN}.lnk"
|
|
|
|
Delete "$DESKTOP\${APP_NAME_ZH_CN}.lnk"
|
2021-11-05 10:44:23 +08:00
|
|
|
|
2024-03-30 17:53:42 +08:00
|
|
|
DeleteRegKey ShCtx "Software\Classes\DevCpp.dev"
|
|
|
|
DeleteRegKey ShCtx "Software\Classes\DevCpp.c"
|
|
|
|
DeleteRegKey ShCtx "Software\Classes\DevCpp.cpp"
|
|
|
|
DeleteRegKey ShCtx "Software\Classes\DevCpp.cxx"
|
|
|
|
DeleteRegKey ShCtx "Software\Classes\DevCpp.cc"
|
|
|
|
DeleteRegKey ShCtx "Software\Classes\DevCpp.h"
|
|
|
|
DeleteRegKey ShCtx "Software\Classes\DevCpp.hpp"
|
|
|
|
DeleteRegKey ShCtx "Software\Classes\DevCpp.hxx"
|
2024-03-29 19:14:30 +08:00
|
|
|
${NotifyShell_AssocChanged}
|
2021-11-05 10:44:23 +08:00
|
|
|
|
|
|
|
Delete "$INSTDIR\NEWS.md"
|
|
|
|
Delete "$INSTDIR\RedPandaIDE.exe"
|
|
|
|
Delete "$INSTDIR\ConsolePauser.exe"
|
2022-02-25 12:06:04 +08:00
|
|
|
Delete "$INSTDIR\redpanda-win-git-askpass.exe"
|
2021-11-05 10:44:23 +08:00
|
|
|
Delete "$INSTDIR\astyle.exe"
|
|
|
|
Delete "$INSTDIR\LICENSE"
|
|
|
|
Delete "$INSTDIR\README.md"
|
2023-11-19 16:41:36 +08:00
|
|
|
Delete "$INSTDIR\qt.conf"
|
2024-03-31 08:23:30 +08:00
|
|
|
Delete "$INSTDIR\OpenConsole.exe"
|
2021-11-05 10:44:23 +08:00
|
|
|
|
|
|
|
RMDir /r "$INSTDIR\Lang"
|
|
|
|
RMDir /r "$INSTDIR\Templates"
|
2024-03-29 08:22:02 +08:00
|
|
|
RMDir /r "$INSTDIR\mingw32"
|
|
|
|
RMDir /r "$INSTDIR\mingw64"
|
2024-03-31 08:23:30 +08:00
|
|
|
RMDir /r "$INSTDIR\llvm-mingw"
|
2021-11-05 10:44:23 +08:00
|
|
|
|
2024-03-30 00:00:56 +08:00
|
|
|
RMDir "$INSTDIR"
|
2021-11-05 10:44:23 +08:00
|
|
|
|
|
|
|
; Remove registry keys
|
2024-03-30 10:35:45 +08:00
|
|
|
DeleteRegKey ShCtx "${UNINSTKEY}"
|
2024-03-28 14:54:17 +08:00
|
|
|
DeleteRegKey ShCtx "Software\RedPanda-C++"
|
2021-11-05 10:44:23 +08:00
|
|
|
|
2024-03-29 08:12:48 +08:00
|
|
|
MessageBox MB_YESNO "$(MessageRemoveConfig)" /SD IDNO IDNO SkipRemoveConfig
|
2021-11-07 10:48:09 +08:00
|
|
|
RMDir /r "$APPDATA\RedPandaIDE"
|
2024-03-29 08:12:48 +08:00
|
|
|
SkipRemoveConfig:
|
2021-11-05 10:44:23 +08:00
|
|
|
|
2024-03-28 14:54:17 +08:00
|
|
|
SectionEnd
|