1 Star 6 Fork 1

zhouxs1023/mU

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setup.nsi 6.83 KB
一键复制 编辑 原始数据 按行查看 历史
# Auto-generated by EclipseNSIS Script Wizard
# 2011-3-29 20:53:46
Name maTHmU
RequestExecutionLevel highest
# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION 0.4
!define COMPANY 廪ѧѧmaTHmUоЭ
!define URL http://www.mathmu.cn/
# MUI Symbol Definitions
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
!define MUI_STARTMENUPAGE_DEFAULTFOLDER maTHmU
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall-colorful.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
# Included files
!include Sections.nsh
!include MUI2.nsh
!include EnvVarUpdate.nsh
# Variables
Var StartMenuGroup
# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# Installer languages
!insertmacro MUI_LANGUAGE SimpChinese
# Installer attributes
OutFile mu-setup.exe
InstallDir $PROGRAMFILES\maTHmU
CRCCheck on
XPStyle on
ShowInstDetails show
VIProductVersion 0.4.0.0
VIAddVersionKey ProductName maTHmU
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"
VIAddVersionKey CompanyWebsite "${URL}"
VIAddVersionKey FileVersion "${VERSION}"
VIAddVersionKey FileDescription ""
VIAddVersionKey LegalCopyright ""
InstallDirRegKey HKLM "${REGKEY}" Path
ShowUninstDetails show
# TODO: check for existing installation of maTHmU, and abort if one is detected
# Installer sections
Section -Main SEC0000
SetOutPath $INSTDIR
SetOverwrite on
File mU.exe
File mU.ini
SetOutPath $INSTDIR\Package
File Package\Stream.dll
File Package\Differential.dll
SetOutPath $INSTDIR\Package\Differential
File Package\Differential\D.u
File Package\Function.dll
File Package\Graphics.dll
SetOutPath $INSTDIR\Package\Integration
File Package\Integration\Integrate.u
File Package\Matrix.dll
File Package\NumberTheory.dll
File Package\Polynomial.dll
SetOutPath $INSTDIR\Package\Polynomial
File Package\Polynomial\UniSolve.u
SetOutPath $INSTDIR\Package\Product
File Package\Product\Prod.u
SetOutPath $INSTDIR\Package\Summation
File Package\Summation\Sum.u
SetOutPath $INSTDIR\Package\TeX
File Package\TeX\TeX.tr
File Package\TeX\TeX.u
SetOutPath $INSTDIR
File C:\MinGW\bin\libstdc++-6.dll
File C:\MinGW\bin\libboost_system-mgw45-mt-1_46.dll
File C:\MinGW\bin\libgcc_s_dw2-1.dll
File C:\MinGW\bin\libgmp-10.dll
File C:\MinGW\bin\libmpfr-1.dll
WriteRegStr HKLM "${REGKEY}\Components" Main 1
SectionEnd
Section -post SEC0001
WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
SetOutPath $INSTDIR
WriteUninstaller $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
SetOutPath $SMPROGRAMS\$StartMenuGroup
CreateShortCut "$SMPROGRAMS\$StartMenuGroup\mU kernel.lnk" $INSTDIR\mU.exe
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_END
${EnvVarUpdate} $0 "PATH" "A" "HKLM" $INSTDIR
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
SectionEnd
# Macro for selecting uninstaller sections
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
Push $R0
ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
StrCmp $R0 1 0 next${UNSECTION_ID}
!insertmacro SelectSection "${UNSECTION_ID}"
GoTo done${UNSECTION_ID}
next${UNSECTION_ID}:
!insertmacro UnselectSection "${UNSECTION_ID}"
done${UNSECTION_ID}:
Pop $R0
!macroend
# Uninstaller sections
Section /o -un.Main UNSEC0000
Delete /REBOOTOK $INSTDIR\libmpfr-1.dll
Delete /REBOOTOK $INSTDIR\libgmp-10.dll
Delete /REBOOTOK $INSTDIR\libgcc_s_dw2-1.dll
Delete /REBOOTOK $INSTDIR\libboost_system-mgw45-mt-1_46.dll
Delete /REBOOTOK $INSTDIR\libstdc++-6.dll
Delete /REBOOTOK $INSTDIR\Package\TeX\TeX.u
Delete /REBOOTOK $INSTDIR\Package\TeX\TeX.tr
Delete /REBOOTOK $INSTDIR\Package\Summation\Sum.u
Delete /REBOOTOK $INSTDIR\Package\Product\Prod.u
Delete /REBOOTOK $INSTDIR\Package\Polynomial\UniSolve.u
Delete /REBOOTOK $INSTDIR\Package\Polynomial.dll
Delete /REBOOTOK $INSTDIR\Package\NumberTheory.dll
Delete /REBOOTOK $INSTDIR\Package\Matrix.dll
Delete /REBOOTOK $INSTDIR\Package\Integration\Integrate.u
Delete /REBOOTOK $INSTDIR\Package\Graphics.dll
Delete /REBOOTOK $INSTDIR\Package\Function.dll
Delete /REBOOTOK $INSTDIR\Package\Differential\D.u
Delete /REBOOTOK $INSTDIR\Package\Differential.dll
Delete /REBOOTOK $INSTDIR\Package\Stream.dll
Delete /REBOOTOK $INSTDIR\mU.ini
Delete /REBOOTOK $INSTDIR\mU.exe
DeleteRegValue HKLM "${REGKEY}\Components" Main
SectionEnd
Section -un.post UNSEC0001
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\mU kernel.lnk"
Delete /REBOOTOK $INSTDIR\uninstall.exe
DeleteRegValue HKLM "${REGKEY}" StartMenuGroup
DeleteRegValue HKLM "${REGKEY}" Path
DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
DeleteRegKey /IfEmpty HKLM "${REGKEY}"
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
RmDir /REBOOTOK $INSTDIR
SectionEnd
# Installer functions
Function .onInit
InitPluginsDir
FunctionEnd
# Uninstaller functions
Function un.onInit
ReadRegStr $INSTDIR HKLM "${REGKEY}" Path
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
!insertmacro SELECT_UNSECTION Main ${UNSEC0000}
FunctionEnd
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhouxs1023/mU.git
git@gitee.com:zhouxs1023/mU.git
zhouxs1023
mU
mU
master

搜索帮助