examples/chat/chat.nsi
author Stefan Vogel <sv@exept.de>
Thu, 11 Apr 2019 18:36:26 +0200
branchcvs_MAIN
changeset 3898 d8c5eadc3a52
parent 3412 df11bb428463
child 3913 aabe49ce9998
permissions -rw-r--r--
#REFACTORING by stefan class: JavaVM class changed: #loadClassesIn:matching: use \"asFilename pathName\" instead of \"asFilename asAbsoluteFilename pathName\" ist is equivalent!

; $Header: /cvs/stx/stx/libjava/examples/chat/chat.nsi,v 1.2 2015-03-20 12:08:02 vrany Exp $
; Script generated by ProjectDefinition.

!define PRODUCT_NAME "Chat"
!define PRODUCT_FILENAME "Chat"
!define PRODUCT_VERSION "6.2.3.0"
!define PRODUCT_PUBLISHER "eXept Software AG"
!define PRODUCT_WEB_SITE "http://www.exept.de"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_FILENAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"

!define STX_ROOT "..\..\..\.."

SetCompressor /solid lzma

!include "MUI2.nsh"
!include "x64.nsh"

; MUI Settings

!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
;; !define MUI_ICON "nil.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
;; !define MUI_UNICON "nil.ico"

; Language Selection Dialog Settings
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"

; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
; !define MUI_LICENSEPAGE_CHECKBOX


!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "German"

; MUI end ------



Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
VIProductVersion "${PRODUCT_VERSION}.0"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${PRODUCT_NAME}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${PRODUCT_PUBLISHER}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "6.2.32767.32767"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${PRODUCT_NAME} Installer"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${PRODUCT_VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright Jan Vrany 2013"


OutFile "ChatSetup.exe"
InstallDir "$PROGRAMFILES\chat"
ShowInstDetails show
ShowUnInstDetails show

Function .onInit
  !insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd

InstType Full
InstType Partial

Section "Programme" Section1
  SectionIn 1 2
  SetOutPath "$INSTDIR\bin"
  SetOverwrite ifnewer
  File "chat.exe"
  File "*.dll"
  File "symbols.stc"
  File "*.stx"
  File "*.rc"
  File /r /x CVS /x ".*" resources





  WriteRegStr HKCR "Stx.Chat.1" "" "Chat File"
  WriteRegStr HKCR "Stx.Chat.1\DefaultIcon" "" '$INSTDIR\bin\chat.exe,0'
  WriteRegStr HKCR "Stx.Chat.1\Shell\open" "" $(appOpen)
  WriteRegStr HKCR "Stx.Chat.1\Shell\open\command" "" '"$INSTDIR\bin\chat.exe" -- "%1"'
SectionEnd

;; Section "Online-Documentation for Chat" Section2
;;   SectionIn 1
;;   SetOutPath "$INSTDIR\doc"
;;   SetOverwrite ifnewer
;;   File /r /x CVS "${STX_ROOT}\stx\chat\doc\*"
;; SectionEnd

;; Section "Chat Libraries and Demos" Section3
;;   SectionIn 1
;;   SetOutPath "$INSTDIR\lib"
;;   SetOverwrite ifnewer
;; ;   File /r /x CVS "${STX_ROOT}\stx\chat\examples\*"
;; SectionEnd
;; 
;; Section "Chat Reports and Printing" Section4
;;   SectionIn 1
;;   SetOutPath "$INSTDIR\reportGenerator"
;;   SetOverwrite ifnewer
;; ;  File /r /x CVS "..\reportGenerator\java" "..\reportGenerator\rules" "..\reportGenerator\*.xml" "..\reportGenerator\*.xslt" "..\reportGenerator\CloseApp.exe" "..\reportGenerator\expecco.jpg"
;; SectionEnd








Section -AdditionalIcons
  SetOutPath "$INSTDIR\bin"
  WriteIniStr "$INSTDIR\${PRODUCT_FILENAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
  CreateDirectory "$SMPROGRAMS\${PRODUCT_FILENAME}"
  CreateShortCut "$SMPROGRAMS\${PRODUCT_FILENAME}\chat.lnk" "$INSTDIR\bin\chat.exe"
  CreateShortCut "$DESKTOP\chat.lnk" "$INSTDIR\bin\chat.exe"
  CreateShortCut "$SMPROGRAMS\${PRODUCT_FILENAME}\Website.lnk" "$INSTDIR\${PRODUCT_FILENAME}.url"
  CreateShortCut "$SMPROGRAMS\${PRODUCT_FILENAME}\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd

Section -Post
  WriteUninstaller "$INSTDIR\uninst.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}" "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

LangString appOpen ${LANG_GERMAN}  "Mit Chat öffnen"
LangString appOpen ${LANG_ENGLISH} "Open with Chat"

LangString DESC_Section1 ${LANG_ENGLISH} "Program components of Chat"
LangString DESC_Section1 ${LANG_GERMAN}  "Alle Programmkomponenten von Chat"
;; LangString DESC_Section2 ${LANG_ENGLISH} "Online-Documentation of Chat"
;; LangString DESC_Section2 ${LANG_GERMAN}  "Online-Dokumentation zu Chat"
;; LangString DESC_Section3 ${LANG_ENGLISH} "Libraries and Demo Projects"
;; LangString DESC_Section3 ${LANG_GERMAN}  "Bibliotheken und Beispielprojekte"
;; LangString DESC_Section4 ${LANG_ENGLISH} "Logfile Printing and Report Generation"
;; LangString DESC_Section4 ${LANG_GERMAN}  "Drucken und Report-Generierung aus Log-Dateien"
;; LangString DESC_Section3 ${LANG_ENGLISH} "Sources of ST/X (Base-System)"
;; LangString DESC_Section3 ${LANG_GERMAN}  "Quellcode von ST/X (Basis-System)"
;; LangString DESC_Section4 ${LANG_ENGLISH} "Sources of Chat"
;; LangString DESC_Section4 ${LANG_GERMAN}  "Quellcode von Chat"


!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  !insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)
;;   !insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)
;;  !insertmacro MUI_DESCRIPTION_TEXT ${Section3} $(DESC_Section3)
;;  !insertmacro MUI_DESCRIPTION_TEXT ${Section4} $(DESC_Section4)

!insertmacro MUI_FUNCTION_DESCRIPTION_END



Function un.onUninstSuccess
  HideWindow
  MessageBox MB_ICONINFORMATION|MB_OK "Chat wurde erfolgreich deinstalliert"
FunctionEnd

Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Möchten Sie Chat und alle seine Komponenten deinstallieren?" IDYES +2
  Abort
FunctionEnd

Section Uninstall
  Delete "$INSTDIR\${PRODUCT_FILENAME}.url"
  Delete "$INSTDIR\uninst.exe"

    Delete "$INSTDIR\*"
    RMDir /r "$INSTDIR"

  Delete "$SMPROGRAMS\${PRODUCT_FILENAME}\Uninstall.lnk"
  Delete "$SMPROGRAMS\${PRODUCT_FILENAME}\Website.lnk"
  Delete "$SMPROGRAMS\${PRODUCT_FILENAME}\chat.lnk"
  Delete "$DESKTOP\chat.lnk"

  RMDir "$SMPROGRAMS\${PRODUCT_FILENAME}"

  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  DeleteRegKey HKCR "Stx.Chat.1"



  SetAutoClose true
SectionEnd