From: <cod...@go...> - 2008-07-16 21:56:17
|
Author: M0E.lnx Date: Wed Jul 16 14:55:37 2008 New Revision: 45 Removed: branches/iVL/Notes Modified: branches/iVL/.lang/FMain.pot branches/iVL/.lang/FrmPartSel.pot branches/iVL/.lang/FrmSelISO.pot branches/iVL/.lang/MdlCore.pot branches/iVL/.lang/MdlDiskPart.pot branches/iVL/.lang/MdlPartSel.pot branches/iVL/FMain.class branches/iVL/FrmPartSel.class branches/iVL/FrmSelISO.class branches/iVL/MdlCore.module Log: Fixed problem resulting when only one(1) ISO was found in a linux partition. Re-wrote the function that detects ISOs on eachpartition. Modified: branches/iVL/.lang/FMain.pot ============================================================================== --- branches/iVL/.lang/FMain.pot (original) +++ branches/iVL/.lang/FMain.pot Wed Jul 16 14:55:37 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/new-inst/FMain.class +# /home/moises/area-51/projects/installer/FMain.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. @@ -14,23 +14,23 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: FMain.class:154 +#: FMain.class:160 msgid "Process Overview" msgstr "" -#: FMain.class:167 +#: FMain.class:173 msgid "Vector Linux Install" msgstr "" -#: FMain.class:177 +#: FMain.class:183 msgid "Next" msgstr "" -#: FMain.class:183 +#: FMain.class:189 msgid "Back" msgstr "" -#: FMain.class:189 +#: FMain.class:195 msgid "Exit" msgstr "" Modified: branches/iVL/.lang/FrmPartSel.pot ============================================================================== --- branches/iVL/.lang/FrmPartSel.pot (original) +++ branches/iVL/.lang/FrmPartSel.pot Wed Jul 16 14:55:37 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/new-inst/FrmPartSel.class +# /home/moises/area-51/projects/installer/FrmPartSel.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. @@ -14,27 +14,27 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: FrmPartSel.class:139 +#: FrmPartSel.class:140 msgid "Define where the operating system will be installed\n<br>\nLinux is a modular operating system. This means that it has the ability to keep system and user data separately.<br> A recommended setup would included a / (root), a /home, and a swap partitions.\n<br>\nPlease select which partitions you would like to use for your install" msgstr "" -#: FrmPartSel.class:147 +#: FrmPartSel.class:148 msgid "<b>Partition</b>" msgstr "" -#: FrmPartSel.class:153 +#: FrmPartSel.class:154 msgid "<b>Mount Point</b>" msgstr "" -#: FrmPartSel.class:159 +#: FrmPartSel.class:160 msgid "<b>File System</b>" msgstr "" -#: FrmPartSel.class:166 +#: FrmPartSel.class:167 msgid "Check this box if you have a Windows installation on your system or any other windows partition (FAT, FAT32, NTFS) that you want auto-mounted as soon as your computer starts" msgstr "" -#: FrmPartSel.class:167 +#: FrmPartSel.class:168 msgid "Detect and Setup Windows partitions for auto-mounting at boot" msgstr "" Modified: branches/iVL/.lang/FrmSelISO.pot ============================================================================== --- branches/iVL/.lang/FrmSelISO.pot (original) +++ branches/iVL/.lang/FrmSelISO.pot Wed Jul 16 14:55:37 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/new-inst/FrmSelISO.class +# /home/moises/area-51/projects/installer/FrmSelISO.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. @@ -14,19 +14,19 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: FrmSelISO.class:189 +#: FrmSelISO.class:211 msgid "No installable images found." msgstr "" -#: FrmSelISO.class:195 +#: FrmSelISO.class:217 msgid "Select which distribution to install from the list below" msgstr "" -#: FrmSelISO.class:200 +#: FrmSelISO.class:222 msgid "TextLabel1" msgstr "" -#: FrmSelISO.class:205 +#: FrmSelISO.class:227 msgid "Search Again" msgstr "" Modified: branches/iVL/.lang/MdlCore.pot ============================================================================== --- branches/iVL/.lang/MdlCore.pot (original) +++ branches/iVL/.lang/MdlCore.pot Wed Jul 16 14:55:37 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/new-inst/MdlCore.module +# /home/moises/area-51/projects/installer/MdlCore.module # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/MdlDiskPart.pot ============================================================================== --- branches/iVL/.lang/MdlDiskPart.pot (original) +++ branches/iVL/.lang/MdlDiskPart.pot Wed Jul 16 14:55:37 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/new-inst/MdlDiskPart.module +# /home/moises/area-51/projects/installer/MdlDiskPart.module # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/MdlPartSel.pot ============================================================================== --- branches/iVL/.lang/MdlPartSel.pot (original) +++ branches/iVL/.lang/MdlPartSel.pot Wed Jul 16 14:55:37 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/new-inst/MdlPartSel.module +# /home/moises/area-51/projects/installer/MdlPartSel.module # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/FMain.class ============================================================================== --- branches/iVL/FMain.class (original) +++ branches/iVL/FMain.class Wed Jul 16 14:55:37 2008 @@ -118,6 +118,12 @@ IF NOT ClsPartSel.sRoot OR ClsPartSel.sRoot = "" THEN Message.Error("You must select a \"/\" partition. This is the target where the system will install to") STOP EVENT + ELSE + IF ClsPartSel.bDoWin = TRUE THEN + frmNext = FrmWinDrives + ELSE + ' move from here to the file copying step + END IF END IF END SELECT Modified: branches/iVL/FrmPartSel.class ============================================================================== --- branches/iVL/FrmPartSel.class (original) +++ branches/iVL/FrmPartSel.class Wed Jul 16 14:55:37 2008 @@ -54,6 +54,7 @@ ME.cbDoWin.Width = MdlObjSizer.get_object_width(cbDoWin.text) + 24 MdlPartSel.DISPLAY_PARTITION_OPTIONS ME.cbDoWin.Value = FALSE + ClsPartSel.bDoWin = FALSE END @@ -107,11 +108,11 @@ PUBLIC SUB cbDoWin_Click() ClsPartSel.bDoWin = cbDoWin.Value - IF ClsPartSel.bDoWin = TRUE THEN - FMain.frmNext = FrmWinDrives - ELSE - ' Move towards installing packages - END IF + ' ' IF ClsPartSel.bDoWin = TRUE THEN + ' ' FMain.frmNext = FrmWinDrives + ' ' ELSE + ' ' ' Move towards installing packages + ' ' END IF END Modified: branches/iVL/FrmSelISO.class ============================================================================== --- branches/iVL/FrmSelISO.class (original) +++ branches/iVL/FrmSelISO.class Wed Jul 16 14:55:37 2008 @@ -23,12 +23,11 @@ DIM sLocation AS String DIM ipos1 AS Integer - IF lstInstallableImg.Count > 0 THEN IF lstInstallableImg.Text <> "No Installable Media Found" THEN - - IF InStr(lstInstallableImg.Text, ".iso") OR InStr(lstInstallableImg.Text, ".ISO") = TRUE THEN + IF InStr(Trim(lstInstallableImg.Text), ".iso") OR InStr(Trim(lstInstallableImg.Text), ".ISO") = TRUE THEN sLocation = Left(lstInstallableImg.Text, InStr(lstInstallableImg.Text, " ") - 1) + ELSE ipos1 = RInStr(ME.lstInstallableImg.Text, "/") sLocation = Right(ME.lstInstallableImg.Text, Len(ME.lstInstallableImg.Text) - ipos1) @@ -36,11 +35,9 @@ 'function to read the file ME.DESCRIBE_DISTRO(sLocation) END IF + ELSE + RETURN ' quiet return... we already know there are no images found END IF - 'Message.Info(File.Load(Temp$(sLocation))) - - - END @@ -54,6 +51,21 @@ FMain.FrmCurr = ME FMain.frmNext = FrmPartScheme + ' shape the main form according to the findings + 'warn the user if no installable media was found + + IF FrmSelISO.lstInstallableImg.Count = 0 THEN + FrmSelISO.lstInstallableImg.Add("No Installable Media Found") + FrmSelISO.tlDistroDesc.Text = "Setup was unable to find any installable media on your system. Please insert your VectorLinux " & + "installation CD and click \'" & FrmSelISO.btResCan.Text & "\' to try again" + FMain.btnext.Enabled = FALSE + FMain.btnext.ForeColor = Color.Gray + ELSE + FMain.btnext.Enabled = TRUE + FMain.btnext.ForeColor = Color.Black + END IF + + @@ -61,7 +73,7 @@ PUBLIC SUB DESCRIBE_DISTRO(sLoc AS String) - DIM sFile AS String[] = Split(File.Load(Temp$(sLoc)), gb.NewLine) + DIM sFile AS String[] DIM sLine AS String DIM i AS Integer DIM iSep AS String @@ -69,6 +81,16 @@ DIM sDist, sVer, iMinRoot, iMinHome, iMinSwap AS String +' Message.Info(File.Load(Temp(sLoc))) +'Message.Info(sLoc) + IF sLoc <> "" THEN + sFile = Split(File.Load(Temp$(sLoc)), gb.NewLine) + ELSE + 'can't find Distro ID + Message.Error("Unable to identify distro.") + RETURN + END IF + IF sFile THEN FOR i = 0 TO sFile.count - 1 sLine = Trim(sFile[i]) Modified: branches/iVL/MdlCore.module ============================================================================== --- branches/iVL/MdlCore.module (original) +++ branches/iVL/MdlCore.module Wed Jul 16 14:55:37 2008 @@ -25,47 +25,59 @@ PUBLIC sDonePic AS Picture = Picture["images/check.png"] -PUBLIC SUB SEARCH_LINUX_DRIVES_FOR_MEDIA(sDev AS String) - DIM sIsoList AS String[] - DIM sResults AS String - DIM sISO AS String + +PUBLIC SUB FIND_ISO_ON_DRIVE(sDrive AS String) + + DIM sISOList AS String[] + DIM sResults, sISO AS String DIM i AS Integer - SHELL "sudo mount " & sDev & Space(1) & ClsGlobal.sSourceMnt WAIT - SHELL "ls " & ClsGlobal.sSourceMnt & "| grep -i vl* | grep -i iso" TO sResults - 'SHELL "ls / | grep -i VL* | grep -i iso" TO sResults - sResults = Trim(sResults) - IF InStr(sResults, gb.NewLine) THEN - sIsoList = Split(sResults, gb.NewLine) - FOR i = 0 TO sIsoList.Count - 1 - sISO = Trim(sIsoList[i]) - IF FrmSelISO.lstInstallableImg.Find(sISO & " on " & sDev) = -1 THEN - FrmSelISO.lstInstallableImg.Add(sISO & " on " & sDev) - ' save the temp file for distro description - SHELL "sudo mount -o loop " & ClsGlobal.sSourceMnt &/ sISO & " /mnt/loop" WAIT - File.Save(Temp(sISO), SConv(File.Load("/mnt/loop/veclinux/SETUP.CONF"))) - SHELL "sudo umount /mnt/loop" WAIT - - END IF - NEXT - ELSE ' only one ISO on this drive - IF sResults THEN - sISO = Trim(sResults) - IF FrmSelISO.lstInstallableImg.Find(sISO & " on " & sDev) = -1 THEN - FrmSelISO.lstInstallableImg.Add(sISO & " on " & sDev) - SHELL "sudo mount -o loop " & ClsGlobal.sSourceMnt &/ sISO & " /mnt/loop" WAIT - File.Save(Temp(sISO), SConv(File.Load("/mnt/loop/veclinux/SETUP.CONF"))) - SHELL "sudo umount /mnt/loop" WAIT - - END IF - END IF - END IF - SHELL "sudo umount " & ClsGlobal.sSourceMnt WAIT - + SHELL "sudo mount " & sDrive & Space(1) & ClsGlobal.sSourceMnt WAIT + SHELL "ls " & ClsGlobal.sSourceMnt & " | grep -i vl* | grep -i iso" TO sResults + sResults = Trim(sResults) + 'Message(sResults) + IF sResults <> "" THEN + IF InStr(sResults, gb.NewLine) THEN 'more than one iso was found... do a loop for each one + ' this loop will mount each iso and store it's SETUP.CONF to a temp file + sISOList = Split(sResults, gb.NewLine) + FOR i = 0 TO sISOList.count - 1 + sIso = Trim(sISOList[i]) + SHELL "sudo umount /mnt/loop" WAIT + SHELL "sudo mount -o loop " & ClsGlobal.sSourceMnt &/ sISO & Space(1) & "/mnt/loop" WAIT + File.Save(Temp(siso), File.Load("/mnt/loop/veclinux/SETUP.CONF")) + SHELL "sudo umount /mnt/loop" WAIT + IF FrmSelISO.lstInstallableImg.Find(sISO & " on " & sDrive) = -1 THEN + FrmSelISO.lstInstallableImg.Add(sISO & " on " & sDrive) + END IF + + NEXT + SHELL "sudo umount " & ClsGlobal.sSourceMnt WAIT + + + + ELSE ' only one iso found + SHELL "sudo umount /mnt/loop" WAIT 'clear the mount point + SHELL "sudo mount -o loop " & ClsGlobal.sSourceMnt &/ sResults & Space(1) & " /mnt/loop" WAIT + File.Save(Temp(sResults), File.Load("/mnt/loop/veclinux/SETUP.CONF")) + 'Message(File.Load(Temp(sResults))) + SHELL "sudo umount /mnt/loop && sudo umount " & ClsGlobal.sSourceMnt WAIT + IF FrmSelISO.lstInstallableImg.Find(sResults & " on " & sDrive) = -1 THEN + FrmSelISO.lstInstallableImg.Add(sResults & " on " & sDrive) + END IF + END IF + + ELSE 'no ISO's found + SHELL "sudo umount " & ClsGlobal.sSourceMnt + + END IF + + END + + PUBLIC SUB SCAN_LINUX_PARTITIONS() DIM sResults AS String @@ -76,22 +88,20 @@ 'SHELL "sudo /sbin/probepart | grep -e \"*Linux$\" | cut -f 1 -d \' \'" TO sResults SHELL "export PATH=$PATH:/sbin && sudo /sbin/probepart | grep -e \" *Linux$\" | cut -f 1 -d \' \'" TO sResults sResults = Trim(sResults) - + 'Message.Info(sResults) IF InStr(sResults, gb.NewLine) THEN sPartList = Split(sResults, gb.NewLine) FOR i = 0 TO sPartList.count - 1 sPartition = Trim(sPartList[i]) - 'now scan this partition - ME.SEARCH_LINUX_DRIVES_FOR_MEDIA(sPartition) + 'now scan this partition + ME.FIND_ISO_ON_DRIVE(sPartition) + NEXT ELSE ' only one linux partition found sPartition = Trim(sResults) - ME.SEARCH_LINUX_DRIVES_FOR_MEDIA(sPartition) + ME.FIND_ISO_ON_DRIVE(sPartition) END IF - - - - + END @@ -170,20 +180,7 @@ 'NOW SEARCH FOR ISOS ON THE DRIVES ME.SCAN_LINUX_PARTITIONS() - ' shape the main form according to the findings - 'warn the user if no installable media was found - IF FrmSelISO.lstInstallableImg.Count = 0 THEN - FrmSelISO.lstInstallableImg.Add("No Installable Media Found") - FrmSelISO.tlDistroDesc.Text = "Setup was unable to find any installable media on your system. Please insert your VectorLinux " & - "installation CD and click \'" & FrmSelISO.btResCan.Text & "\' to try again" - FMain.btnext.Enabled = FALSE - FMain.btnext.ForeColor = Color.Gray - ELSE - FMain.btnext.Enabled = TRUE - FMain.btnext.ForeColor = Color.Black - END IF - END |