W3C home > Mailing lists > Public > www-amaya@w3.org > January to March 2003

NSIS Installer Conversion

From: Brant Langer Gurganus <brantgurganus2001@cherokeescouting.org>
Date: Mon, 03 Mar 2003 20:29:31 -0500
Message-ID: <3E64017B.3000105@cherokeescouting.org>
To: Irene Vatton <irene.vatton@inrialpes.fr>
CC: Amaya Mailing List <www-amaya@w3.org>
It appears that there are dialogue files for non-English languages
included in the base installation.  Is this correct?  Also, does Amaya
need fonts.unix, etc. on Windows to run properly.  I would think it only
needs fonts.win.

Also, are there folders where wildcards can be used instead of listing 
individual files or will CVS control files get included then.  Any 
preference on bzip2 (smaller) or zlib (faster) compression?

If wildcards will work, I currently have an installer that should 
install all the files.  I haven't messed with uninstaller related stuff 
or start menu stuff.  I've attached my current incarnation of the script 
if you want to tinker with it or try compiling it.  NSIS can be 
downloaded from <http://nsis.sourceforge.net/>.  I am using NSIS 2 beta 
2 + CVS updates.

I'm tweaking installation locations slightly to conform to the Designed 
for Windows guidelines.

I am currently planning to make the installer multi-lingual so I will 
need some people to translate strings when I am finished.  I will 
probably need the license in other languages as well.  I think the 
COPYRIGHT file currently uses line feeds so I might need to make a CR/LF 
file to work in the installer.

Brant Langer Gurganus

If "Actions speak louder than words," how is that "The pen is mightier 
than the sword."?

# Amaya Installation Script
# Created By brantgurganus2001@cherokeescouting.org

# Include header for Modern UI
  !include "MUI.nsh"

# Define Location Constants
  # Source Locations
    !define SRC_BASE "c:\src\amaya"
    !define SRC_AMAYA "${SRC_BASE}\amaya"
    !define SRC_ANNOTLIB "${SRC_BASE}\annotlib"
    !define SRC_CONFIG "${SRC_BASE}\config"
    !define SRC_DICTIONARY "${SRC_BASE}\dicopar"
    !define SRC_FONTS "${SRC_BASE}\fonts"
    !define SRC_HELP "${SRC_BASE}\doc"
  # Destination Directories
    !define DEST_AMAYA "$INSTDIR\amaya"
    !define DEST_BIN "$INSTDIR\bin"
    !define DEST_CONFIG "$INSTDIR\config"
    !define DEST_DICTIONARY "$INSTDIR\dicopar"
    !define DEST_FONTS "$INSTDIR\fonts"
    !define DEST_HELP "$INSTDIR\doc"

# Define Product Constants
  !define COMPANY "W3C"
  !define MUI_PRODUCT "Amaya"
  !define MUI_VERSION "7.2+"

# Modern UI Settings

  # Start Menu Settings
  # Finish Page Settings
    # Run Program Settings
      !define MUI_FINISHPAGE_RUN "${DEST_BIN}\amaya.exe"
    # Show Readme Settings
  # Miscellaneous Settings
    # Uninstaller Settings
# Interface Settings
  !define MUI_ICON "${SRC_AMAYA}\appicon.ico"
  !define MUI_UNICON "${SRC_AMAYA}\appicon.ico"
# Installer Settings
  CRCCheck force
  XPStyle on
  LicenseData "${SRC_AMAYA}\COPYRIGHT"
  OutFile "${SRC_BASE}\${MUI_PRODUCT}-${MUI_VERSION}-setup.exe"
  Icon "${SRC_AMAYA}\appicon.ico"
  ShowInstDetails show
  ShowUninstDetails show
  SilentInstall normal
  SilentUnInstall normal
# Compressor Settings
  SetCompress auto
  SetCompressor zlib
  SetDatablockOptimize on
  SetDateSave on
  SetOverwrite ifnewer
# Modern UI Macro
  !insertmacro MUI_SYSTEM

# Language Files
  !insertmacro MUI_LANGUAGE "English"
  !insertmacro MUI_LANGUAGE "Spanish"
  !insertmacro MUI_LANGUAGE "French"
  !insertmacro MUI_LANGUAGE "German"
  !insertmacro MUI_LANGUAGE "Portuguese"
  !insertmacro MUI_LANGUAGE "Italian"
  !insertmacro MUI_LANGUAGE "Turkish"
  !insertmacro MUI_LANGUAGE "Finnish"

# Descriptions
  LangString DESC_Section1 ${LANG_ENGLISH} "This is the Amaya editor."
  LangString DESC_Section2 ${LANG_ENGLISH} "This is the Spanish documentation."
  LangString DESC_Section3 ${LANG_ENGLISH} "This is the French documentation."
  LangString DESC_Section4 ${LANG_ENGLISH} "This is the German documentation."
  LangString DESC_Section5 ${LANG_ENGLISH} "This is the Portuguese documentation."
  LangString DESC_Section6 ${LANG_ENGLISH} "This is the Italian documentation."
  LangString DESC_Section7 ${LANG_ENGLISH} "This is the Turkish documentation."
  LangString DESC_Section8 ${LANG_ENGLISH} "This is the Finnish documentation.

    !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_DESCRIPTION_TEXT ${Section5} ${DESC_Section5}
    !insertmacro MUI_DESCRIPTION_TEXT ${Section6} ${DESC_Section6}
    !insertmacro MUI_DESCRIPTION_TEXT ${Section7} ${DESC_Section7}
    !insertmacro MUI_DESCRIPTION_TEXT ${Section8} ${DESC_Section8}

# Sections
  Section "Amaya" Section1
    # Program Files
      SetOutPath "${DEST_BIN}"
      File /r "${SRC_BIN}"
    # Amaya Files
      SetOutPath "${DEST_AMAYA}"
      File /r "${SRC_ANNOTLIB}"
      File /r "${SRC_AMAYA}"
    # Configuration Files
      SetOutPath "${DEST_CONFIG}"
      File /r "${SRC_CONFIG}"
    # Dictionary Files
      SetOutPath "${DEST_DICTIONARY}"
      File /r "${SRC_DICTIONARY}"
    # Font Files
      SetOutPath "$(DEST_FONTS)"
      File /r "${SRC_FONTS}"
    # English Help
      SetOutPath "${DEST_HELP}"
      File /r "${SRC_HELP}"


  Section "Spanish" Section3
  Section "Uninstall"
    # This is the uninstallation routine.
    DeleteRegValue HKCU "Software\${MUI_PRODUCT}" "Installer Language"
    !insertmacro MUI_UNFINISHHEADER

# Write Start Menu Entries
  # Start Menu is not implemented yet.

# Functions
  Function .onInit
    # Font
      Push Tahoma
      Push 8
    # Languages
      !insertmacro MUI_LANGDLL_PUSH "English"
      !insertmacro MUI_LANGDLL_PUSH "French"
      !insertmacro MUI_LANGDLL_PUSH "Spanish"
    Push 3F 
    LangDLL::LangDialog "Installer Language" "Please select a language."
    StrCmp $LANGUAGE "cancel" 0 +2
  Function un.onInit
    ReadRegStr $LANGUAGE HKCU "Software\${MUI_PRODUCT}" "Installer Language"
Received on Monday, 3 March 2003 20:30:28 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:53:27 UTC