From: Kern Sibbald Date: Fri, 16 Oct 2009 15:48:16 +0000 (+0200) Subject: More Win installer changes X-Git-Tag: Release-3.0.3~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9eb201697a4fbcfed6ffdbe6721bcdf06e45611;p=thirdparty%2Fbacula.git More Win installer changes --- diff --git a/bacula/src/win32/win32_installer/InstallType.ini b/bacula/src/win32/win32_installer/InstallType.ini index a87189c72..73fb8d939 100644 --- a/bacula/src/win32/win32_installer/InstallType.ini +++ b/bacula/src/win32/win32_installer/InstallType.ini @@ -1,3 +1,8 @@ +; +; Note: certain text in this file is overwritten by the code in +; InstallType.nsh +; + [Settings] NumFields=6 @@ -30,7 +35,7 @@ Bottom=54 Type=RadioButton Text=Custom (not recommended) Left=6 -Right=200 +Right=252 Top=90 Bottom=100 diff --git a/bacula/src/win32/win32_installer/InstallType.nsh b/bacula/src/win32/win32_installer/InstallType.nsh index 0a0f90253..396f88bf8 100644 --- a/bacula/src/win32/win32_installer/InstallType.nsh +++ b/bacula/src/win32/win32_installer/InstallType.nsh @@ -1,98 +1,99 @@ -Function EnterInstallType - Push $R0 - Push $R1 - Push $R2 - - ; Check if this is an upgrade by looking for an uninstaller configured - ; in the registry. - ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "UninstallString" - - ${If} "$R0" != "" - ; Check registry for new installer - ReadRegStr $R1 HKLM "Software\Bacula" "InstallLocation" - ${If} "$R1" != "" - ; New Installer - StrCpy $OldInstallDir $R1 - StrCpy $InstallType ${UpgradeInstall} - - SetShellVarContext all - - StrCpy $R1 "$APPDATA\Bacula" - StrCpy $R2 "$INSTDIR\Doc" - - ReadRegDWORD $PreviousComponents HKLM "Software\Bacula" "Components" - - WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 1" "Text" "A previous installation has been found in $OldInstallDir. Please choose the installation type for any additional components you select." - WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The configuration files for additional components will be generated using defaults applicable to most installations." - WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "The configuration defaults for additional components will be displayed and you will be given the chance to make changes before the configuration files are written." - - ReadRegDWORD $ConfigDirectorDB HKLM Software\Bacula Database - - ${If} $ConfigDirectorDB = 0 - IntOp $R0 $PreviousComponents & ${ComponentDirector} - ${If} $R0 <> 0 - StrCpy $ConfigDirectorDB 1 - ${EndIf} - ${EndIf} - ${Else} - ; Processing Upgrade - Get Install Directory - ${StrRep} $R0 $R0 '"' '' - ${GetParent} $R0 $OldInstallDir - - ; Old Installer - StrCpy $InstallType ${MigrateInstall} - StrCpy $R1 "$OldInstallDir\bin" - StrCpy $R2 "$OldInstallDir\Doc" - - WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 1" "Text" "An old installation has been found in $OldInstallDir. The Configuration will be migrated. Please choose the installation type for any additional components you select." - WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The software will be installed in the default directory $\"$PROGRAMFILES\Bacula$\". The configuration files for additional components will be generated using defaults applicable to most installations." - WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "You may choose the installation directory. The configuration defaults will be displayed and you will be given the chance to make changes before the configuration files are written." - ${EndIf} - ${Else} - ; New Install - StrCpy $InstallType ${NewInstall} - WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The software will be installed in the default directory $\"$PROGRAMFILES\Bacula$\". The configuration files will be generated using defaults applicable to most installations." - ${EndIf} - - ${If} $InstallType <> ${NewInstall} - ${AndIf} $PreviousComponents = 0 - ${If} ${FileExists} "$R1\bacula-fd.conf" - IntOp $PreviousComponents $PreviousComponents | ${ComponentFile} - ${EndIf} - ${If} ${FileExists} "$R1\bconsole.conf" - IntOp $PreviousComponents $PreviousComponents | ${ComponentTextConsole} - ${EndIf} - ${If} ${FileExists} "$R1\wx-console.conf" - IntOp $PreviousComponents $PreviousComponents | ${ComponentGUIConsole} - ${EndIf} - ${If} ${FileExists} "$R2\bacula.pdf" - IntOp $PreviousComponents $PreviousComponents | ${ComponentPDFDocs} - ${EndIf} - ${If} ${FileExists} "$R2\bacula\bacula.html" - IntOp $PreviousComponents $PreviousComponents | ${ComponentHTMLDocs} - ${EndIf} - ${If} ${FileExists} "$R2\bacula.html" - IntOp $PreviousComponents $PreviousComponents | ${ComponentHTMLDocs} - ${EndIf} - ${EndIf} - - !InsertMacro MUI_HEADER_TEXT "$(TITLE_InstallType)" "$(SUBTITLE_InstallType)" - !InsertMacro MUI_INSTALLOPTIONS_INITDIALOG "InstallType.ini" - Pop $HDLG ;HWND of dialog - - !insertmacro MUI_INSTALLOPTIONS_SHOW - - ; Process Results - - !insertmacro MUI_INSTALLOPTIONS_READ $R0 "InstallType.ini" "Field 3" "State" - - ${If} $R0 = 1 - StrCpy $AutomaticInstall 1 - ${Else} - StrCpy $AutomaticInstall 0 - ${EndIf} - - Pop $R2 - Pop $R1 - Pop $R0 -FunctionEnd +Function EnterInstallType + Push $R0 + Push $R1 + Push $R2 + + ; Check if this is an upgrade by looking for an uninstaller configured + ; in the registry. + ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "UninstallString" + + ${If} "$R0" != "" + ; Check registry for new installer + ReadRegStr $R1 HKLM "Software\Bacula" "InstallLocation" + ${If} "$R1" != "" + ; New Installer + StrCpy $OldInstallDir $R1 + StrCpy $InstallType ${UpgradeInstall} + + SetShellVarContext all + + StrCpy $R1 "$APPDATA\Bacula" + StrCpy $R2 "$INSTDIR\Doc" + + ReadRegDWORD $PreviousComponents HKLM "Software\Bacula" "Components" + + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 1" "Text" "A previous installation has been found in $OldInstallDir. Please choose the installation type for any additional components you select." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The configuration files for additional components will be generated using defaults applicable to most installations." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "You have more options, but you will have to manually edit your bacula-fd.conf file before Bacula will work." + + ReadRegDWORD $ConfigDirectorDB HKLM Software\Bacula Database + + ${If} $ConfigDirectorDB = 0 + IntOp $R0 $PreviousComponents & ${ComponentDirector} + ${If} $R0 <> 0 + StrCpy $ConfigDirectorDB 1 + ${EndIf} + ${EndIf} + ${Else} + ; Processing Upgrade - Get Install Directory + ${StrRep} $R0 $R0 '"' '' + ${GetParent} $R0 $OldInstallDir + + ; Old Installer + StrCpy $InstallType ${MigrateInstall} + StrCpy $R1 "$OldInstallDir\bin" + StrCpy $R2 "$OldInstallDir\Doc" + + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 1" "Text" "An old installation has been found in $OldInstallDir. The Configuration will be migrated. Please choose the installation type for any additional components you select." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The software will be installed in the default directory $\"$PROGRAMFILES\Bacula$\". The configuration files for additional components will be generated using defaults applicable to most installations." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "You have more options, but you will have to manually edit your bacula-fd.conf file before Bacula will work." + ${EndIf} + ${Else} + ; New Install + StrCpy $InstallType ${NewInstall} + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The software will be installed in the default directory $\"$PROGRAMFILES\Bacula$\". The configuration files will be generated using defaults applicable to most installations." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "You have more options, but you will have to manually edit your bacula-fd.conf file before Bacula will work." + ${EndIf} + + ${If} $InstallType <> ${NewInstall} + ${AndIf} $PreviousComponents = 0 + ${If} ${FileExists} "$R1\bacula-fd.conf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentFile} + ${EndIf} + ${If} ${FileExists} "$R1\bconsole.conf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentTextConsole} + ${EndIf} + ${If} ${FileExists} "$R1\wx-console.conf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentGUIConsole} + ${EndIf} + ${If} ${FileExists} "$R2\bacula.pdf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentPDFDocs} + ${EndIf} + ${If} ${FileExists} "$R2\bacula\bacula.html" + IntOp $PreviousComponents $PreviousComponents | ${ComponentHTMLDocs} + ${EndIf} + ${If} ${FileExists} "$R2\bacula.html" + IntOp $PreviousComponents $PreviousComponents | ${ComponentHTMLDocs} + ${EndIf} + ${EndIf} + + !InsertMacro MUI_HEADER_TEXT "$(TITLE_InstallType)" "$(SUBTITLE_InstallType)" + !InsertMacro MUI_INSTALLOPTIONS_INITDIALOG "InstallType.ini" + Pop $HDLG ;HWND of dialog + + !insertmacro MUI_INSTALLOPTIONS_SHOW + + ; Process Results + + !insertmacro MUI_INSTALLOPTIONS_READ $R0 "InstallType.ini" "Field 3" "State" + + ${If} $R0 = 1 + StrCpy $AutomaticInstall 1 + ${Else} + StrCpy $AutomaticInstall 0 + ${EndIf} + + Pop $R2 + Pop $R1 + Pop $R0 +FunctionEnd diff --git a/bacula/src/win32/win64_installer/InstallType.ini b/bacula/src/win32/win64_installer/InstallType.ini index 562d5d9a5..73fb8d939 100644 --- a/bacula/src/win32/win64_installer/InstallType.ini +++ b/bacula/src/win32/win64_installer/InstallType.ini @@ -1,3 +1,8 @@ +; +; Note: certain text in this file is overwritten by the code in +; InstallType.nsh +; + [Settings] NumFields=6 diff --git a/bacula/src/win32/win64_installer/InstallType.nsh b/bacula/src/win32/win64_installer/InstallType.nsh index 1863a9424..5f4cfaa3c 100644 --- a/bacula/src/win32/win64_installer/InstallType.nsh +++ b/bacula/src/win32/win64_installer/InstallType.nsh @@ -24,7 +24,7 @@ Function EnterInstallType WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 1" "Text" "A previous installation has been found in $OldInstallDir. Please choose the installation type for any additional components you select." WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The configuration files for additional components will be generated using defaults applicable to most installations." - WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "The configuration defaults for additional components will be displayed and you will be given the chance to make changes before the configuration files are written." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "You have more options, but you will have to manually edit your bacula-fd.conf file before Bacula will work." ReadRegDWORD $ConfigDirectorDB HKLM Software\Bacula Database @@ -46,12 +46,13 @@ Function EnterInstallType WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 1" "Text" "An old installation has been found in $OldInstallDir. The Configuration will be migrated. Please choose the installation type for any additional components you select." WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The software will be installed in the default directory $\"C:\Program Files\Bacula$\". The configuration files for additional components will be generated using defaults applicable to most installations." - WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "You may choose the installation directory. The configuration defaults will be displayed and you will be given the chance to make changes before the configuration files are written." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "You have more options, but you will have to manually edit your bacula-fd.conf file before Bacula will work." ${EndIf} ${Else} ; New Install StrCpy $InstallType ${NewInstall} WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The software will be installed in the default directory $\"C:\Program Files\Bacula$\". The configuration files will be generated using defaults applicable to most installations." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "You have more options, but you will have to manually edit your bacula-fd.conf file before Bacula will work." ${EndIf} ${If} $InstallType <> ${NewInstall}