NSIS

!define PRODUCT_NAME "装箱大师企业版"
!define PRODUCT_VERSION "4.0"
!define PRODUCT_PUBLISHER "北京达纬恒通信息技术有限公司"
!define PRODUCT_WEB_SITE "http://www.zhuangxiang.com"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\ProductActivation.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define MUI_WELCOMEFINISHPAGE_BITMAP "F:\workspace\pic.bmp"
!define MUI_WELCOMEPAGE_TITLE "\r\n       装箱大师企业版4.0"
!define MUI_WELCOMEPAGE_TEXT "LoadMaster装箱大师集装箱软件是目前国际市场上集装箱装箱率最高的一套集装箱软件。它致力于为客户提供高度优化的集装箱装箱方案,帮助客户降低货物运输环节的费用。适用于计算货柜装箱、集装箱拼箱、卡车装箱、火车装箱、纸箱装箱、托盘装箱。\
\r\n\r\n单击[下一步] 继续安装 [取消]将取消安装 "
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\装箱大师新增功能.txt"
!define MUI_FINISHPAGE_SHOWREADME_TEXT "查看 装箱大师新增功能"

SetCompressor lzma
!include "MUI.nsh"

!define MUI_ABORTWARNING
!define MUI_ICON "F:\tub\LD.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"

!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "e:\SoftwareLicence.txt"

!insertmacro MUI_PAGE_DIRECTORY

!insertmacro MUI_PAGE_INSTFILES

!define MUI_FINISHPAGE_RUN "$INSTDIR\LoadMasterMain.exe"
!insertmacro MUI_PAGE_FINISH


!insertmacro MUI_UNPAGE_INSTFILES

!insertmacro MUI_LANGUAGE "SimpChinese"

 

!insertmacro MUI_RESERVEFILE_LANGDLL
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS


Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "LoadMaster_Setup.exe"
InstallDir "$PROGRAMFILES\LoadMaster4.0"
InstallDirRegKey HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
ShowInstDetails show
ShowUnInstDetails show
BrandingText "装箱大师竭诚为您服务  http://www.zhuangxiang.com/"

Section "-MainSection" SEC01
  SetOutPath "$INSTDIR"
  SetOverwrite ifnewer
  File "F:\workspace2\RenderSystem_GL.dll"
  CreateDirectory "$SMPROGRAMS\装箱大师企业版"
  CreateShortCut "$SMPROGRAMS\装箱大师企业版\装箱大师企业版4.0.lnk" "$INSTDIR\LoadMasterMain.exe"
  CreateShortCut "$DESKTOP\装箱大师企业版4.0.lnk" "$INSTDIR\LoadMasterMain.exe"
   setoutpath  $INSTDIR
file /r  "f:\workspace2\*.*"
SectionEnd


Section -AdditionalIcons
  WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
  CreateShortCut "$SMPROGRAMS\装箱大师企业版\装箱大师官方网站.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
  CreateShortCut "$SMPROGRAMS\装箱大师企业版\装箱大师企业版帮助文档.lnk" "$INSTDIR\Manual.chm"  
  CreateShortCut "$SMPROGRAMS\装箱大师企业版\卸载装箱大师企业版.lnk" "$INSTDIR\uninst.exe"
 
SectionEnd

Section -Post
  WriteUninstaller "$INSTDIR\uninst.exe"
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\ProductActivation.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\ProductActivation.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd

Function .onInit
    !insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd


Section Uninstall
  Delete "$INSTDIR\${PRODUCT_NAME}.url"
  Delete "$INSTDIR\uninst.exe"
  Delete "$INSTDIR\templet.zh-CHN.xls"
  Delete "$INSTDIR\templet.zh-CN.xls"
  Delete "$INSTDIR\templet.xls"
  Delete "$INSTDIR\resources.cfg"
  Delete "$INSTDIR\cg.dll"
  Delete "$INSTDIR\csgl.dll"
  Delete "$INSTDIR\csgl.native.dll"
  Delete "$INSTDIR\Csla.dll"
  Delete "$INSTDIR\database.mdb"
  Delete "$INSTDIR\GEARS.ico"
  Delete "$INSTDIR\HID.exe"
  Delete "$INSTDIR\InitMogre.dll"
  Delete "$INSTDIR\LoadMasterMain.exe"
  Delete "$INSTDIR\LoadMasterMain.exe.config"
  Delete "$INSTDIR\Manual.chm"
  Delete "$INSTDIR\Mogre.dll"
  Delete "$INSTDIR\MOIS.dll"
  Delete "$INSTDIR\Ogre.log"
  Delete "$INSTDIR\OgreMain.dll"
  Delete "$INSTDIR\OIS.dll"
  Delete "$INSTDIR\Plugin_BSPSceneManager.dll"
  Delete "$INSTDIR\Plugin_CgProgramManager.dll"
  Delete "$INSTDIR\Plugin_OctreeSceneManager.dll"
  Delete "$INSTDIR\Plugin_ParticleFX.dll"
  Delete "$INSTDIR\plugins.cfg"
  Delete "$INSTDIR\ProductActivation.exe"
  Delete "$INSTDIR\ProductActivation.exe.config"
  Delete "$INSTDIR\ProductActivation.pdb"
  Delete "$INSTDIR\ProductActivation.vshost.exe.config"
  Delete "$INSTDIR\RenderSystem_Direct3D9.dll"
  Delete "$INSTDIR\RenderSystem_GL.dll"

  Delete "$SMPROGRAMS\装箱大师企业版\卸载装箱大师企业版.lnk"
  Delete "$SMPROGRAMS\装箱大师企业版\装箱大师官方网站.lnk"
  Delete "$SMPROGRAMS\装箱大师企业版\装箱大师企业版帮助文档.lnk"
  Delete "$DESKTOP\装箱大师企业版4.0.lnk"
  Delete "$SMPROGRAMS\装箱大师企业版\装箱大师企业版4.0.lnk"

  RMDir "$SMPROGRAMS\装箱大师企业版"

  RMDir "$INSTDIR"
 
  RMDir /r "$INSTDIR"

  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
  SetAutoClose true
SectionEnd


Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "您确实要完全移除 $(^Name) ,及其所有的组件?" IDYES +2
  Abort
FunctionEnd

Function un.onUninstSuccess
  HideWindow
  MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) 已成功地从您的计算机移除。"
FunctionEnd

posted @ 2008-09-24 19:09  kin2321  阅读(442)  评论(0编辑  收藏  举报