NSIS Installer Conversion

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
http://www.cherokeescouting.org/OtherUnits/Troop545IIN/brant.xhtml

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
  !define MUI_WELCOMEPAGE
  !define MUI_LICENSEPAGE
  !define MUI_COMPONENTSPAGE
  !define MUI_DIRECTORYPAGE
  !define MUI_STARTMENUPAGE
  !define MUI_FINISHPAGE

  # Start Menu Settings
    !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${COMPANY}\${MUI_PRODUCT}"
  
  # Finish Page Settings
    # Run Program Settings
      !define MUI_FINISHPAGE_RUN "${DEST_BIN}\amaya.exe"
      !define MUI_FINISHPAGE_RUN_NOTCHECKED
      
    # Show Readme Settings
      !define MUI_FINISHPAGE_SHOWREADME
      
    !define MUI_FINISHPAGE_NOREBOOTSUPPORT
  
  # Miscellaneous Settings
    !define MUI_ABORTWARNING
    !define MUI_UNINSTALLER
    
    # Uninstaller Settings
      !define MUI_UNCONFIRMPAGE
      
# Interface Settings
  !define MUI_ICON "${SRC_AMAYA}\appicon.ico"
  !define MUI_UNICON "${SRC_AMAYA}\appicon.ico"
  
# Installer Settings
  CRCCheck force
  InstallDir "$PROGRAMFILES\${COMPANY}\${MUI_PRODUCT}\"
  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_FUNCTIONS_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_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}
  !insertmacro MUI_FUNCTIONS_DESCRIPTION_END

# 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}"

  SectionEnd

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

# Write Start Menu Entries
  !insertmacro MUI_STARTMENU_WRITE_BEGIN
  # Start Menu is not implemented yet.
  !insertmacro MUI_STARTMENU_WRITE_END

# 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."
    
    Pop $LANGUAGE
    StrCmp $LANGUAGE "cancel" 0 +2
      Abort
  FunctionEnd
  
  Function un.onInit
    ReadRegStr $LANGUAGE HKCU "Software\${MUI_PRODUCT}" "Installer Language"
  FunctionEnd

Received on Monday, 3 March 2003 20:30:28 UTC