dion        2003/10/09 18:24:40

  Added:       src/installer/nsis maven_setup.nsi maven-logo.bmp
                        maven-website.bmp maven.bmp
  Log:
  Add installer files from my stuff.
  This needs merging with Kristen and Brett's
  
  Revision  Changes    Path
  1.1                  maven/src/installer/nsis/maven_setup.nsi
  
  Index: maven_setup.nsi
  ===================================================================
  ; Author Kristen Gillard
  ; Author Dion Gillard
  ; Installation Script for Maven
  ; http://maven.apache.org/
  
  ; macro for the image on the install screen
  !macro BIMAGE IMAGE PARMS
        Push $0
        GetTempFileName $0
        File /oname=$0 "${IMAGE}"
        SetBrandingImage ${PARMS} $0
        Delete $0
        Pop $0
  !macroend
  
  !define MAVEN_SRC_HOME "..\..\.."
  !define MAVEN_VERSION "1.0-rc1"
  !define MAVEN_REG_KEY "SOFTWARE\Apache Software Foundation\Maven\${MAVEN_VERSION}"
  !define MAVEN_REG_UNINSTALL_KEY 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache Maven ${MAVEN_VERSION}"
  !define MAVEN_STARTMENU_FOLDER "$SMPROGRAMS\Apache Maven ${MAVEN_VERSION}"
  ;
  ; This needs to be parameterised
  ;
  !define MAVEN_DIST_DIR "c:\temp\maven-1.0-rc1"
  
  ; Do a Cyclic Redundancy Check to make sure the installer is not corrupt
  CRCCheck on
  
  ; The name of the installer
  Name "Apache Maven"
  
  ; Maven Setup executable
  OutFile "maven-${MAVEN_VERSION}.exe"
  
  ; Adds an XP manifest to the installer
  XPStyle on
  
  ; branding with maven logo
  AddBrandingImage left 70|267
  
  ; Sets the font of the installer
  SetFont "Arial" 8
  
  ; License Information
  LicenseText "This program is Licensed under The Apache Software License, Version 
1.1."
  LicenseData "${MAVEN_SRC_HOME}\LICENSE.txt"
  
  ; The default installation directory
  InstallDir "$PROGRAMFILES\Apache Software Foundation\Maven ${MAVEN_VERSION}"
  ; Registry key to check for directory (so if you upgrade, it will 
  ; overwrite the old one automatically)
  InstallDirRegKey HKLM "${MAVEN_REG_KEY}" "Install_Dir"
  
  ; The text to prompt the user to enter a directory
  ComponentText "This will install Maven on your computer."
  ; The text to prompt the user to enter a directory
  DirText "Maven Home Directory"
  
  ; -------------------------------------------------------------- Package up the 
files to be installed
  Section "Maven v${MAVEN_VERSION} Binaries"
    ; Set output path to the installation directory.
    SetOutPath $INSTDIR
    ; Put files and directories there
    ; the script will be run from a directory below Maven
    File /r "${MAVEN_DIST_DIR}\*.*"
  
    ; Write the installation path into the registry
    WriteRegStr HKLM "${MAVEN_REG_KEY}" "Install_Dir" "$INSTDIR"
    
    ; TODO Write the environment variables to the Registry
  
    ; WriteRegStr HKCU "Environment" "MAVEN_HOME" "$INSTDIR"
    ; WriteRegStr HKCU "Environment" "MAVEN_LOCAL_HOME" "$INSTDIR"
  
    ; Write the uninstall keys for Windows
    WriteRegStr HKLM "${MAVEN_REG_UNINSTALL_KEY}" "DisplayName" "Maven 
${MAVEN_VERSION} (remove only)"
    WriteRegStr HKLM "${MAVEN_REG_UNINSTALL_KEY}" "UninstallString" 
'"$INSTDIR\Uninst.exe"'
  SectionEnd
  
  ; -------------------------------------------------------------- Create Shortcuts
  Section "Create Start Menu Shortcut(s)"
    CreateDirectory "${MAVEN_STARTMENU_FOLDER}"
    CreateShortCut "${MAVEN_STARTMENU_FOLDER}\Maven.lnk" "$INSTDIR\bin\maven.bat" "" 
"$INSTDIR\bin\maven.bat" 0
    CreateShortCut "${MAVEN_STARTMENU_FOLDER}\Install Maven Repository.lnk" 
"$INSTDIR\bin\install_repo.bat" "" "$INSTDIR\install_repo.bat" 0
    CreateShortCut "${MAVEN_STARTMENU_FOLDER}\Uninstall.lnk" "$INSTDIR\Uninst.exe" "" 
"$INSTDIR\Uninst.exe" 0
    CreateShortCut "${MAVEN_STARTMENU_FOLDER}\Homepage.lnk" "http://maven.apache.org/";
    CreateShortCut "${MAVEN_STARTMENU_FOLDER}\User Guide.lnk" 
"http://maven.apache.org/reference/user-guide.html";
    CreateShortCut "${MAVEN_STARTMENU_FOLDER}\Core Plugins.lnk" 
"http://maven.apache.org/reference/plugins/core-plugins.html";
    CreateShortCut "${MAVEN_STARTMENU_FOLDER}\Optional Plugins.lnk" 
"http://maven.apache.org/reference/plugins/optional/optional.html";
    CreateShortCut "${MAVEN_STARTMENU_FOLDER}\Reference.lnk" 
"http://maven.apache.org/reference/index.html";
    CreateShortCut "${MAVEN_STARTMENU_FOLDER}\Report a Bug.lnk" 
"http://jira.codehaus.org/secure/BrowseProject.jspa?id=10030";
  SectionEnd
  
  ; OPTIONAL Desktop Shortcut 
  ; Section "Create Desktop Shortcut"
  ;  CreateShortCut "$DESKTOP\Maven.lnk" "$INSTDIR\bin\maven.bat" "" 
"$INSTDIR\bin\maven.bat"
  ;SectionEnd
  
  ; -------------------------------------------------------------- Section to Install 
the Uninstaller
  Section "Install Uninstaller"
     ; write the uninstaller to the installation directory
     WriteUninstaller "$INSTDIR\Uninst.exe"
  SectionEnd
  
  ; -------------------------------------------------------------- Maven Uninstaller
  Section "Uninstall"
    ; remove registry keys
    DeleteRegKey HKLM "${MAVEN_REG_UNINSTALL_KEY}"
    DeleteRegKey HKLM "${MAVEN_REG_KEY}"
  
    ; remove files
    Delete $INSTDIR\*.*
  
    ; MUST REMOVE UNINSTALLER, too
    Delete $INSTDIR\Uninst.exe
  
    ; remove shortcuts, if any.
    Delete "${MAVEN_STARTMENU_FOLDER}\*.*"
    RMDir "${MAVEN_STARTMENU_FOLDER}"
    ; Delete "$DESKTOP\Maven.lnk"
    ; Recursively remove files and directories used
    ; this should also take care of the installer  
    RMDir /r "$INSTDIR"
    ; MessageBox MB_OK|MB_ICONEXCLAMATION "Maven has been 'Uninstalled'"
  SectionEnd
  
  ; -------------------------------------------------------------- Add Images to the 
Installer / UnInstaller
  Function .onGUIInit
     !insertmacro BIMAGE "maven.bmp" ""
     ; TODO Check for a JAVA_HOME environment variable
     ; If it doesn't exist
     ;   check the registry for one
     ;   if that exists
     ;     set that as JAVA_HOME
     ;   else
     ;     MessageBox about maven needing java home set to run?
  
  FunctionEnd
  
  ; add the maven logo to the un-installer
  Function un.onGUIInit
     !insertmacro BIMAGE "maven.bmp" ""
  FunctionEnd
  
  ; -------------------------------------------------------------- End of File
  
  
  
  1.1                  maven/src/installer/nsis/maven-logo.bmp
  
        <<Binary file>>
  
  
  1.1                  maven/src/installer/nsis/maven-website.bmp
  
        <<Binary file>>
  
  
  1.1                  maven/src/installer/nsis/maven.bmp
  
        <<Binary file>>
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to