Index: contrib/mingw/ChangeLog
===================================================================
--- contrib/mingw/ChangeLog	(revision f6cd0dbeadb89f13c616bc3bce19fad59093759b)
+++ contrib/mingw/ChangeLog	(revision 56f6b90763f719373f7e618d8d82047edc2baa48)
@@ -1,2 +1,17 @@
+2007-08-03	Chris Johns <chisj@rtems.org>
+	* rtems_logo.bmp: Clipped to get the correct proportions
+	in the installer's header.
+
+	* upload.sh: Install only the specific build installers.
+
+	* rtems.ini: Change to show the actual web paths.
+
+	* version: Build 15.
+
+	* build-exes.sh, msys-path.nsi, rtems-autotools.nsi,
+	rtems-tools.nsi: Fixed MSYS path detection. Fixed the uninstaller
+	registry data. Changed the way the top level is generated. Now all
+	the sections are added no matter what target is specified.
+
 2007-07-28	Chris Johns <chisj@rtems.org>
 	* README, build-rpms.sh, rtems.ini, build-exes.sh,
Index: contrib/mingw/build-exes.sh
===================================================================
--- contrib/mingw/build-exes.sh	(revision f6cd0dbeadb89f13c616bc3bce19fad59093759b)
+++ contrib/mingw/build-exes.sh	(revision 56f6b90763f719373f7e618d8d82047edc2baa48)
@@ -9,5 +9,5 @@
 #
 
-echo $*
+echo $0 $*
 
 source=$(dirname $0)
@@ -131,4 +131,82 @@
 
 #
+# Write target installer code.
+#
+# $1 - target
+# $2 - target section test
+# $3 - size of the tools
+# $4 - Installer output file name
+# $5 - Output file
+# 
+target_installer_exec()
+{
+  local t=$1
+  local tst=$2
+  local size_in_k=$3
+  local outfile=$4
+  local of=$5
+
+  echo "" >> $of
+  echo "; Target: $t" >> $of
+  echo "Section \"${!tst}\" Section_$t" >> $of
+  echo " AddSize $size_in_k" >> $of
+  echo " StrCpy \$1 \$EXEDIR\\$outfile" >> $of
+  echo " DetailPrint \"Checking for \$1\"" >> $of
+  echo " IfFileExists \$1 ${t}_found" >> $of
+  echo " StrCpy \$1 \$INSTDIR\\Packages\\$outfile" >> $of
+  echo " DetailPrint \"Checking for \$1\"" >> $of
+  echo " IfFileExists \$1 ${t}_found" >> $of
+  echo "  SetOutPath \"\$INSTDIR\Packages\"" >> $of
+  echo "  DetailPrint \"Downloading $rtems_url/$outfile\"" >> $of
+  echo "  NSISdl::download $rtems_url/$outfile $outfile" >> $of
+  echo "  Pop \$R0" >> $of
+  echo "  StrCmp \$R0 \"success\" ${t}_found_2 ${t}_not_found_2" >> $of
+  echo " ${t}_not_found_2:" >> $of
+  echo "   SetDetailsView show" >> $of
+  echo "   DetailPrint \"Download failed: \$R0\"" >> $of
+  echo "   MessageBox MB_OK \"Download failed: \$R0\"" >> $of
+  echo "   Goto ${t}_done" >> $of
+  echo " ${t}_found_2:" >> $of
+  echo "   Strcpy \$1 \"\$INSTDIR\\Packages\\$outfile\"" >> $of
+  echo " ${t}_found:" >> $of
+  echo "  DetailPrint \"Installing: \$1\"" >> $of
+  echo "  ExecWait '\"\$1\" /S /D=\$INSTDIR' \$0" >> $of
+  echo "  BringToFront" >> $of
+  echo "  IntCmp \$0 0 +3" >> $of
+  echo "   MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \"${!tst} install failed. Do you wish to continue ?\" IDYES +2" >> $of
+  echo "   Abort" >> $of
+  echo " ${t}_done:" >> $of
+  echo "SectionEnd" >> $of
+}
+
+#
+# Get the size if kilo-bytes of the package as the listed files.
+#
+# $1 - relocation directory of installed files.
+#
+get_size_in_k()
+{
+  if [ ! -d $1 ]; then
+    terminate "target directory not found: $1"
+  fi
+  if [ ! -f $1/files.txt ]; then
+    terminate "target files not found: $1/files.txt"
+  fi
+
+  local here=$(pwd)
+  check "getting the current directory"
+  cd $1
+  check "changing directory: $1"
+
+  local size_in_k=$(du -c -k $(cat files.txt) | grep total | sed -e "s/\t.*//g")
+  check "getting total size"
+
+  cd $here
+  check "changing directory: $here"
+
+  echo $size_in_k
+}
+
+#
 # Create the installer given the architecture and package.
 #
@@ -136,4 +214,6 @@
 # $2 - package
 # $3 - package name
+# $4 - outfile
+#
 create_installer()
 {
@@ -141,4 +221,5 @@
   local t=$2
   local n=$3
+  local outfile=$4
 
   rpm_options="--ignoreos --force --nodeps --noorder "
@@ -174,4 +255,6 @@
    echo "$files" > $treloc/files.txt
    check "write the file list"
+
+   size_in_k=$(get_size_in_k $treloc)
 
    of=$treloc/rtems-files.nsi
@@ -266,6 +349,4 @@
    check "make the RTEMS binary install point: $rtems_binary"
 
-   outfile=rtems$version-tools-$n-$tool_build.exe
-
    of=$treloc/rtems.nsi
    echo "!define RTEMS_TARGET \"$n\"" > $of
@@ -280,4 +361,5 @@
    echo "!define RTEMS_OUTFILE \"$outfile\"" >> $of
    echo "!define TOOL_PREFIX \"$prefix\"" >> $of
+   echo "!define RTEMS_TOOLS_SIZE \"$size_in_k\"" >> $of
 
    if [ $n = $common_label ]; then
@@ -296,39 +378,5 @@
    check "coping the dialog definition file: $treloc/rtems.ini"
 
-   echo "makensis $of"
-   $makensis $of
-   check "making the installer: $of"
-
-   if [ $n != $common_label ]; then
-     of=$relocation/rtems-sections.nsi
-     tst=${t}_section_text
-     echo "" >> $of
-     echo "; Target: $t" >> $of
-     echo "Section \"${!tst}\" Section_$t" >> $of
-     echo " StrCpy \$1 \$EXEDIR\\$outfile" >> $of
-     echo " DetailPrint \"Checking for \$1\"" >> $of
-     echo " IfFileExists \$1 ${t}_found" >> $of
-     echo " StrCpy \$1 \$INSTDIR\\Packages\\$outfile" >> $of
-     echo " DetailPrint \"Checking for \$1\"" >> $of
-     echo " IfFileExists \$1 ${t}_found" >> $of
-     echo "  SetOutPath \"\$INSTDIR\\Packages\"" >> $of
-     echo "  DetailPrint \"Downloading $rtems_url/$outfile\"" >> $of
-     echo "  NSISdl::download $rtems_url/$outfile $outfile" >> $of
-     echo "  Pop \$R0" >> $of
-     echo "  StrCmp \$R0 \"success\" ${t}_found_2 ${t}_not_found_2" >> $of
-     echo " ${t}_not_found_2:" >> $of
-     echo "   SetDetailsView show" >> $of
-     echo "   DetailPrint \"Download failed: \$R0\"" >> $of
-     echo "   MessageBox MB_OK \"Download failed: \$R0\"" >> $of
-     echo "   Goto ${t}_done" >> $of
-     echo " ${t}_found_2:" >> $of
-     echo "   Strcpy \$1 \"\$INSTDIR\\Packages\\$outfile\"" >> $of
-     echo " ${t}_found:" >> $of
-     echo "  DetailPrint \"Installing: \$1\"" >> $of
-     echo "  ExecWait '\"\$1\" /S'" >> $of
-     echo "  BringToFront" >> $of
-     echo " ${t}_done:" >> $of
-     echo "SectionEnd" >> $of
-   else
+   if [ $n = $common_label ]; then
      echo "Section -SecCommon" >> $of
      echo " SetOutPath \"\$INSTDIR"\" >> $of
@@ -338,4 +386,9 @@
      echo "SectionEnd" >> $of
    fi
+
+   echo "makensis $of"
+   $makensis $of
+   check "making the installer: $of"
+
   fi
 }
@@ -360,4 +413,6 @@
   $mkdir -p $rtems_binary
   check "make the RTEMS binary install point: $rtems_binary"
+
+  size_in_k=2000
 
   outfile=rtems$version-tools-$n-$tool_build.exe
@@ -375,4 +430,5 @@
   echo "!define RTEMS_OUTFILE \"$outfile\"" >> $of
   echo "!define TOOL_PREFIX \"$prefix\"" >> $of
+  echo "!define RTEMS_TOOLS_SIZE \"$size_in_k\"" >> $of
 
   . $source/autoconf.def
@@ -421,30 +477,4 @@
   $makensis $of
   check "making the installer: $of"
-
-  of=$relocation/rtems-sections.nsi
-  tst=${t}_section_text
-  echo "" >> $of
-  echo "; Target: $t" >> $of
-  echo "Section \"${!tst}\" Section_$t" >> $of
-  echo " StrCpy \$1 \$EXEDIR\\$outfile" >> $of
-  echo " IfFileExists \$1 ${t}_found" >> $of
-  echo "  SetOutPath \"\$INSTDIR\Packages\"" >> $of
-  echo "  DetailPrint \"Downloading $rtems_url/$outfile\"" >> $of
-  echo "  NSISdl::download $rtems_url/$outfile $outfile" >> $of
-  echo "  Pop \$R0" >> $of
-  echo "  StrCmp \$R0 \"success\" ${t}_found_2 ${t}_not_found_2" >> $of
-  echo " ${t}_not_found_2:" >> $of
-  echo "   SetDetailsView show" >> $of
-  echo "   DetailPrint \"Download failed: \$R0\"" >> $of
-  echo "   MessageBox MB_OK \"Download failed: \$R0\"" >> $of
-  echo "   Goto ${t}_done" >> $of
-  echo " ${t}_found_2:" >> $of
-  echo "   Strcpy \$1 \"\$INSTDIR\\Packages\\$outfile\"" >> $of
-  echo " ${t}_found:" >> $of
-  echo "  DetailPrint \"Installing: \$1\"" >> $of
-  echo "  ExecWait '\"\$1\" /S'" >> $of
-  echo "  BringToFront" >> $of
-  echo " ${t}_done:" >> $of
-  echo "SectionEnd" >> $of
 }
 
@@ -456,9 +486,19 @@
  echo "; Components based on each target." > $relocation/rtems-sections.nsi
  create_autotools_installer noarch auto autotools
+ target_installer_exec auto auto_section_text 2000 \
+                       rtems$version-tools-autotools-$tool_build.exe \
+                       $relocation/rtems-sections.nsi
  for t in $targets
  do
-  create_installer $p $t $t
+  create_installer $p $t $t rtems$version-tools-$t-$tool_build.exe
+ done
+ for t in $(cat $source/targets)
+ do
+  target_installer_exec $t ${t}_section_text \
+                        $(get_size_in_k $relocation/$t) \
+                        rtems$version-tools-$t-$tool_build.exe \
+                        $relocation/rtems-sections.nsi
  done
  # Must be done last
- create_installer $p $common_label $common_label
+ create_installer $p $common_label $common_label $version-tools-$tool_build.exe
 done
Index: contrib/mingw/msys-path.nsi
===================================================================
--- contrib/mingw/msys-path.nsi	(revision f6cd0dbeadb89f13c616bc3bce19fad59093759b)
+++ contrib/mingw/msys-path.nsi	(revision 56f6b90763f719373f7e618d8d82047edc2baa48)
@@ -48,5 +48,5 @@
   Pop $R0
   ifErrors 0 +3
-   MessageBox MB_OK "MSYS Not Installed. Please install MSYS."
+   MessageBox MB_OK "MSYS Not Installed. Please install MSYS from http://www.mingw.org/"
    Abort
   DetailPrint "Checking Registry for MSYS DTK Installed Path"
@@ -54,5 +54,5 @@
   Pop $R1
   ifErrors 0 +3
-   MessageBox MB_OK "MSYS DTK Not Installed. Please install MSYS DTK."
+   MessageBox MB_OK "MSYS DTK Not Installed. Please install MSYS DTK from http://www.mingw.org/"
    Abort
   StrCmp $R0 $R1 +3 0
@@ -63,5 +63,5 @@
   Pop $R0
   StrCmp $R0 "ok" Found
-   MessageBox MB_OK "MSYS Executable '$R0' not found. Please install."
+   MessageBox MB_OK "MSYS Executable '$R0' not found. Please install from http://www.mingw.org/"
    Abort
  Found:
Index: contrib/mingw/rtems-autotools.nsi
===================================================================
--- contrib/mingw/rtems-autotools.nsi	(revision f6cd0dbeadb89f13c616bc3bce19fad59093759b)
+++ contrib/mingw/rtems-autotools.nsi	(revision 56f6b90763f719373f7e618d8d82047edc2baa48)
@@ -71,4 +71,5 @@
 Section "RTEMS ${RTEMS_TARGET} Tools" SecTools
  SetDetailsView show
+ AddSize ${RTEMS_TOOLS_SIZE}
 
  /*
@@ -77,5 +78,7 @@
  Call MSYSDetect
  Pop $9
-
+ StrCmp $9 "not-found" 0 +3
+  MessageBox MB_OK "Could not find a valid MSYS. Please install from http://www.mingw.org/"
+  Abort
  SetOutPath "$INSTDIR\Uninstall"
  SetOutPath "$INSTDIR\Packages\Build"
@@ -352,11 +355,12 @@
 
 Section -Post
- WriteUninstaller "$INSTDIR\rtems${PRODUCT_VERSION}-${RTEMS_BUILD_VERSION}-tools-${RTEMS_TARGET}-uninst.exe"
+ StrCpy $R0 "$INSTDIR\rtems${PRODUCT_VERSION}-${RTEMS_BUILD_VERSION}-tools-${RTEMS_TARGET}-uninst.exe"
+ WriteUninstaller "$R0"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
                   "DisplayName" "$(^Name)"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
-                  "UninstallString" "$INSTDIR\uninst.exe"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
-                  "DisplayVersion" "${PRODUCT_VERSION}"
+                  "UninstallString" "$R0"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
+                  "DisplayVersion" "${PRODUCT_VERSION} Build-${RTEMS_BUILD_VERSION}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
                   "URLInfoAbout" "${PRODUCT_WEB_SITE}"
Index: contrib/mingw/rtems-tools.nsi
===================================================================
--- contrib/mingw/rtems-tools.nsi	(revision f6cd0dbeadb89f13c616bc3bce19fad59093759b)
+++ contrib/mingw/rtems-tools.nsi	(revision 56f6b90763f719373f7e618d8d82047edc2baa48)
@@ -74,4 +74,5 @@
 
 Section -SecFiles
+ AddSize ${RTEMS_TOOLS_SIZE}
  !insertmacro RTEMS_INSTALL_FILES
 SectionEnd
@@ -270,14 +271,15 @@
 Section -Post
 !ifdef COMMON_FILES
- WriteUninstaller "$INSTDIR\rtems${PRODUCT_VERSION}-${RTEMS_BUILD_VERSION}-tools-uninst.exe"
+ StrCpy $R0 "$INSTDIR\rtems${PRODUCT_VERSION}-${RTEMS_BUILD_VERSION}-tools-uninst.exe"
 !else
- WriteUninstaller "$INSTDIR\rtems${PRODUCT_VERSION}-${RTEMS_BUILD_VERSION}-tools-${RTEMS_TARGET}-uninst.exe"
-!endif
+ StrCpy $R0 "$INSTDIR\rtems${PRODUCT_VERSION}-${RTEMS_BUILD_VERSION}-tools-${RTEMS_TARGET}-uninst.exe"
+!endif
+ WriteUninstaller "$R0"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
                   "DisplayName" "$(^Name)"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
-                  "UninstallString" "$INSTDIR\uninst.exe"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
-                  "DisplayVersion" "${PRODUCT_VERSION}"
+                  "UninstallString" "$R0"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
+                  "DisplayVersion" "${PRODUCT_VERSION} Build-${RTEMS_BUILD_VERSION}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
                   "URLInfoAbout" "${PRODUCT_WEB_SITE}"
Index: contrib/mingw/rtems.ini
===================================================================
--- contrib/mingw/rtems.ini	(revision f6cd0dbeadb89f13c616bc3bce19fad59093759b)
+++ contrib/mingw/rtems.ini	(revision 56f6b90763f719373f7e618d8d82047edc2baa48)
@@ -1,12 +1,16 @@
 ;
+
 ; $Id$
+
 ; Ini file generated by the HM NIS Edit IO designer.
+
 ;
+
 [Settings]
-NumFields=6
+NumFields=8
 
 [Field 1]
 Type=Label
-Text=RTEMS Tools for Windows is a set of MinGW tools suitable for compiling RTEMS and RTEMS applications. You should install download and install the MinGW runtime and if you wish to build RTEMS and if you need autoconf or automake support the MSYS and MSYS DTK packages as well. You can find the MinGW and MSYS installers on the MinGW web site.\r\n\r\nFurther information and the source code with patches can be located via the link below.
+Text=RTEMS Tools for Windows is a set of MinGW tools suitable for compiling RTEMS and RTEMS applications. You should install download and install the MinGW runtime and if you wish to build RTEMS and if you need autoconf or automake support the MSYS and MSYS DTK packages as well. You can find the MinGW and MSYS installers on the MinGW web site.\r\n\r\nFurther information and the source code with patches can be located via the Wiki.
 Left=0
 Right=292
@@ -17,5 +21,5 @@
 Type=Label
 Text=RTEMS Tools for Windows
-Left=75
+Left=74
 Right=297
 Top=0
@@ -24,36 +28,51 @@
 [Field 3]
 Type=Link
-Text=Source Code with patches
-State=http://www.rtems.org/ftp/pub/rtems/SOURCES
-Left=150
-Right=275
-Top=91
-Bottom=99
+Text=http://www.rtems.org/wiki/index.php/MinGW_Tools_for_Windows
+State=http://www.rtems.org/wiki/index.php/MinGW_Tools_for_Windows
+Left=71
+Right=292
+Top=100
+Bottom=108
 
 [Field 4]
 Type=Link
-Text=RTEMS MinGW Wiki Page
-State=http://www.rtems.org/wiki/index.php/MinGW_Tools_for_Windows
-Left=6
-Right=92
+Text=http://www.rtems.org/
+State=http://www.rtems.org/
+Left=71
+Right=187
+Top=89
+Bottom=99
+
+[Field 5]
+Type=Link
+Text=http://www.mingw.org/
+State=http://www.mingw.org/
+Left=71
+Right=196
+Top=112
+Bottom=120
+
+[Field 6]
+Type=Label
+Text=RTEMS Website
+Left=2
+Right=65
+Top=89
+Bottom=97
+
+[Field 7]
+Type=Label
+Text=Tools Wiki
+Left=2
+Right=46
 Top=101
 Bottom=109
 
-[Field 5]
-Type=Link
-Text=RTEMS Home Page
-State=http://www.rtems.org/
-Left=6
-Right=122
-Top=89
-Bottom=99
+[Field 8]
+Type=Label
+Text=MinGW Website
+Left=2
+Right=57
+Top=112
+Bottom=120
 
-[Field 6]
-Type=Link
-Text=MinGW Project Home Page
-State=http://www.mingw.org/
-Left=150
-Right=275
-Top=102
-Bottom=110
-
Index: contrib/mingw/upload.sh
===================================================================
--- contrib/mingw/upload.sh	(revision f6cd0dbeadb89f13c616bc3bce19fad59093759b)
+++ contrib/mingw/upload.sh	(revision 56f6b90763f719373f7e618d8d82047edc2baa48)
@@ -79,5 +79,5 @@
 check "creating: ${ftpbase}/${version}/build-${tool_build}/source"
 
-exes=$(find $exebase -name \*.exe)
+exes=$(find $exebase -name \*-${tool_build}.exe)
 for e in $exes
 do
Index: contrib/mingw/version
===================================================================
--- contrib/mingw/version	(revision f6cd0dbeadb89f13c616bc3bce19fad59093759b)
+++ contrib/mingw/version	(revision 56f6b90763f719373f7e618d8d82047edc2baa48)
@@ -1,2 +1,2 @@
 version=4.8
-tool_build=14
+tool_build=15
