From: <cod...@go...> - 2008-07-11 12:05:21
|
Author: M0E.lnx Date: Fri Jul 11 05:03:45 2008 New Revision: 34 Added: branches/iVL/.lang/ branches/iVL/.project branches/iVL/ClsGlobal.class branches/iVL/FMain.class branches/iVL/FMain.form branches/iVL/FrmDiskPart.class branches/iVL/FrmDiskPart.form branches/iVL/FrmLicense.class branches/iVL/FrmLicense.form branches/iVL/FrmPartScheme.class branches/iVL/FrmPartScheme.form branches/iVL/FrmPartSel.class branches/iVL/FrmPartSel.form branches/iVL/FrmSelISO.class branches/iVL/FrmSelISO.form branches/iVL/MdlCore.module branches/iVL/MdlDiskPart.module branches/iVL/MdlObjSizer.module branches/iVL/MdlPartSel.module branches/iVL/MdlSetup.module branches/iVL/Notes branches/iVL/images/ branches/iVL/images/arrow.png (contents, props changed) branches/iVL/images/check.png (contents, props changed) branches/iVL/images/circle.png (contents, props changed) Log: Load new attempt project. This one was started from scratch, and is much simpler. Added: branches/iVL/.project ============================================================================== --- (empty file) +++ branches/iVL/.project Fri Jul 11 05:03:45 2008 @@ -0,0 +1,20 @@ +# Gambas Project File 2.0 +Title=VectorLinux Installer +Startup=FrmPartSel +Version=0.0.1 +Library=gb.gtk +Library=gb.form +Library=gb.desktop +Library=gb.form.dialog +Library=gb.gtk.ext +Description=GUI installer for Vector linux +Authors=M0E-lnx +TabSize=2 +Translate=1 +Language=en_US +ControlPublic=1 +ModulePublic=1 +Maintainer=benoit +Vendor=Princeton +Address=benoit@localhost +License=General Public Licence Added: branches/iVL/ClsGlobal.class ============================================================================== --- (empty file) +++ branches/iVL/ClsGlobal.class Fri Jul 11 05:03:45 2008 @@ -0,0 +1,42 @@ +' Gambas class file + +' This file is part of vinstall-ng + +' vinstall-ng is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vinstall-ng is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. + + + +STATIC PUBLIC DISTRO AS String = "Vector Linux" ' will be overridden by SETUP.CONF +STATIC PUBLIC VERSION AS String = "6.0" ' will be overridden by SETUP.CONF + +STATIC PUBLIC iRootMin AS Integer = 20000 +STATIC PUBLIC iRootMax AS Integer = 40000 +STATIC PUBLIC iHomeMin AS Integer = 500 +STATIC PUBLIC iSwapMin AS Integer = 64 + +STATIC PUBLIC sRootMnt AS String +STATIC PUBLIC sHomeMnt AS String +STATIC PUBLIC sTargetMnt AS String +STATIC PUBLIC sSourceMnt AS String +STATIC PUBLIC sMediaMnt AS String + +STATIC PUBLIC sBulkList AS String +STATIC PUBLIC sConfPkg AS String + +'Values to these variables is set from mdlcore.main +STATIC PUBLIC sBulkDir AS String +STATIC PUBLIC sPackDir AS String +STATIC PUBLIC sDocDir AS String +STATIC PUBLIC sSetupConfPath AS String +STATIC PUBLIC sReadMePath AS String Added: branches/iVL/FMain.class ============================================================================== --- (empty file) +++ branches/iVL/FMain.class Fri Jul 11 05:03:45 2008 @@ -0,0 +1,154 @@ +' Gambas class file +' This file is part of vinstall-ng + +' vinstall-ng is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vinstall-ng is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. + + + +PRIVATE sLast AS String +PUBLIC sNextKey AS String +PUBLIC FrmCurr AS Form ' assigned when a form is opened +PUBLIC frmLast AS Form ' assigned when a form is hidden + +PUBLIC SUB _new() + +END + +PUBLIC SUB Form_Open() +ClsGlobal.sSourceMnt = User.Home &/ "mnt" &/ "cdrom" +FrmSelISO.Reparent(ME.pnlWinHost) +FrmSelISO.Width = pnlWinHost.Width +FrmSelISO.Height = pnlWinHost.Height +FrmSelISO.Show +MdlCore.PREPARE_INSTALL_LAYOUT +WITH ME + .btback.Enabled = FALSE + .btback.ForeColor = Color.Gray + .btQuit.Text = "Exit Installation" +END WITH +'ME.TreeView1.BackColor = Color.Transparent + + +END + +PUBLIC SUB ComboBox1_Click() + + + +END + + +PUBLIC SUB Form_Resize() + +DIM iMid AS Integer + + WITH ME + iMid = (.btback.Left + .btnext.left + .btnext.Width) / 2 + END WITH + + + WITH ME + .tlBanner.width = ME.width + .Frame1.Move(.tlBanner.left + 4, .tlBanner.Top + .tlBanner.Height + 4, .tlBanner.Width - ((.tlBanner.Width / 10) * 7), .Height - (.tlbanner.height + (.tlbanner.height / 2))) + .tvPlan.Resize(.Frame1.Width - 20, .Frame1.Height - 30) + .pnlWinHost.Move(.Frame1.left + .Frame1.Width + 4, .Frame1.top, .tlBanner.Width - (.Frame1.Width + 8), .Frame1.Height) + .btback.Move(.pnlWinHost.Left, .pnlWinHost.Top + .pnlWinHost.Height - (.btback.Height), MdlObjSizer.get_object_width(.btback.text) + 36) + .btnext.Move(.pnlWinHost.Left + .pnlWinHost.Width - (.btnext.Width + 4), .btback.Top, MdlObjSizer.get_object_width(.btnext.text) + 36) + ' for the quit button, it'll get a little tricky + ' we want that one right in the middle + .btQuit.Move(iMid - (.btQuit.Width / 2), .btback.Top, MdlObjSizer.get_object_width(.btQuit.Text) + 36) + '.pnlWinHost.Move(ME.left + ME.Frame1.Width + 4, Frame1.Top, ME.Width - (Frame1.Width + 4)) + END WITH +END + +PUBLIC SUB Frame1_MouseDown() + + + +END + + + +PUBLIC SUB tvPlan_Select() + + +'tvPlan[sLast].Picture = MdlCore.sDonePic +' +' +' +' IF tvPlan.Current.Picture <> MdlCore.sCatPic THEN +' +' IF sLast THEN +' tvPlan[sLast].Picture = MdlCore.sDonePic +' END IF +' +' tvPlan.Current.Picture = MdlCore.sNowPic + + + +'END IF + +END + +PUBLIC SUB tvPlan_MouseUp() + + IF tvPlan.Current.Picture <> MdlCore.sCatPic THEN + sLast = tvPlan.Current.Key + END IF + +END + +PUBLIC SUB btQuit_Click() + + FMain.Close + +END + + + +PUBLIC SUB btnext_Click() + DIM FrmNext AS Form + DIM sDev AS String + DIM sISONAME AS String + + 'DIM FrmCurr AS Form + + SELECT CASE ME.sNextKey + CASE "Prep0" + ' We'll need to mount the ISO or image and then display the form + sDev = Right(FrmSelISO.lstInstallableImg.Text, Len(FrmSelISO.lstInstallableImg.Text) - InStr(FrmSelISO.lstInstallableImg.text, "/") + 1) + IF InStr(FrmSelISO.lstInstallableImg.text, ".iso") OR InStr(FrmSelISO.lstInstallableImg.text, ".ISO") THEN + sISONAME = Left(FrmSelISO.lstInstallableImg.text, InStr(FrmSelISO.lstInstallableImg.text, " ") - 1) + MdlSetup.GO_WITH_SELECTED(sDev, sISONAME) + ELSE + + MdlSetup.GO_WITH_SELECTED(sDev, "") + END IF + FrmNext = FrmPartScheme + ME.tvPlan.Current.Picture = MdlCore.sDonePic + ME.tvPlan["Prep1"].Selected = TRUE + ME.tvPlan["Prep1"].Picture = MdlCore.sNowPic + + CASE "Prep1" + FrmNext = FrmDiskPart + ME.tvPlan.Current.Picture = MdlCore.sDonePic + ME.tvPlan["Prep2"].Picture = MdlCore.sNowPic + ME.tvPlan["Prep2"].Selected = TRUE + END SELECT + + FrmNext.Reparent(FrmCurr.Parent) + FrmCurr.Hide + FrmNext.Show + +END Added: branches/iVL/FMain.form ============================================================================== --- (empty file) +++ branches/iVL/FMain.form Fri Jul 11 05:03:45 2008 @@ -0,0 +1,40 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,100,75) + Text = ("") + { Frame1 Frame + MoveScaled(1,8,25,62) + Text = ("Process Overview") + { tvPlan TreeView + MoveScaled(1,3,22,56) + Border = False + } + } + { tlBanner TextLabel + MoveScaled(0,0,26,7) + Font = Font["+6"] + Background = Color.SelectedBackground + Foreground = Color.SelectedForeground + Text = ("Vector Linux Install") + Alignment = Align.Center + } + { pnlWinHost VBox + MoveScaled(28,9,66,56) + } + { btnext Button + MoveScaled(89,69,8,3) + Text = ("Next") + Picture = Picture["icon:/16/right"] + } + { btback Button + MoveScaled(28,67,8,3) + Text = ("Back") + Picture = Picture["icon:/16/left"] + } + { btQuit Button + MoveScaled(54,67,11,2) + Text = ("Exit") + Picture = Picture["icon:/16/cancel"] + } +} Added: branches/iVL/FrmDiskPart.class ============================================================================== --- (empty file) +++ branches/iVL/FrmDiskPart.class Fri Jul 11 05:03:45 2008 @@ -0,0 +1,79 @@ +' Gambas class file + +' This file is part of vinstall-ng + +' vinstall-ng is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vinstall-ng is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. + + + + + +PUBLIC SUB Form_Open() + MdlDiskPart.EMBED_GPARTED() + + WITH ME + .tlBanner.Text = "<b>Disk Partitioning:</b><br>" & + "This portion of the setup process allows you to define an installation target for your new operating system." & + "Please use the partition program below to create, resize, or delete partitions, and make room for Vectorlinux." + .tlBanner.Adjust + END WITH + + + + +END + +PUBLIC SUB Form_Resize() + + WITH ME + .tlBanner.Width = .Width + .EmbGPARTED.Move(.tlBanner.Left, .tlBanner.Top + .tlBanner.Height + 4, .ClientWidth - 16, .ClientHeight) + END WITH +END + +PUBLIC SUB EmbGPARTED_Embed() + + FMain.btnext.Enabled = FALSE + FMain.btnext.ForeColor = Color.Gray + FMain.btback.Enabled = FALSE + FMain.btback.ForeColor = Color.Gray + FMain.btQuit.Enabled = FALSE + FMain.btQuit.ForeColor = Color.Gray + + +END + +PUBLIC SUB EmbGPARTED_Close() + + DIM bReboot AS Boolean + bReboot = MdlSetup.CHECK_IF_REBOOT_NEEDED() + + IF bReboot = TRUE THEN ' need to reboot + Message.Info("Your partition setup requires a system reboot. Your computer will now reboot") + 'SHELL "sudo shutdown -r now" + ELSE ' move to the next stage (select which partitions to use as what + FrmPartSel.Reparent(ME.Parent) + ME.Hide + FrmPartSel.Show + + + + FMain.btnext.Enabled = TRUE + FMain.btnext.ForeColor = Color.Black + FMain.btback.Enabled = TRUE + FMain.btback.ForeColor = Color.Black + FMain.btQuit.Enabled = TRUE + FMain.btQuit.ForeColor = Color.Black + END IF +END Added: branches/iVL/FrmDiskPart.form ============================================================================== --- (empty file) +++ branches/iVL/FrmDiskPart.form Fri Jul 11 05:03:45 2008 @@ -0,0 +1,13 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,84,55) + Text = ("") + { tlBanner TextLabel + MoveScaled(1,2,81,9) + Text = ("Disk Partitioning:") + } + { EmbGPARTED Embedder + MoveScaled(1,13,82,39) + } +} Added: branches/iVL/FrmLicense.class ============================================================================== --- (empty file) +++ branches/iVL/FrmLicense.class Fri Jul 11 05:03:45 2008 @@ -0,0 +1,81 @@ +' Gambas class file + +' This file is part of vinstall-ng + +' vinstall-ng is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vinstall-ng is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. + + + +PUBLIC SUB Form_Open() + + ME.tlbanner.Text = "Ready to install " & ClsGlobal.DISTRO & Space(1) & ClsGlobal.VERSION & " to your system. " & + "<br><br>Please read the License agreement and click \'" & FMain.btnext.Text & "\' to continue" + + ME.tlbanner.Adjust + ME.rbNo.Width = MdlObjSizer.get_object_width(ME.rbNo.Text) + 24 + ME.rbYes.Width = MdlObjSizer.get_object_width(ME.rbYes.Text) + 24 + ME.rbNo.Value = TRUE + FMain.btnext.Enabled = FALSE + FMain.btnext.ForeColor = Color.Gray + + + + FMain.sNextKey = "Prep1" + FMain.FrmCurr = ME + + + + +END + +PUBLIC SUB Form_Hide() + + FMain.frmLast = ME + + +END + +PUBLIC SUB Form_Resize() + + + WITH ME + .Reparent(.parent) + .Resize(.Parent.Width, .Parent.Height) + .taLicense.Move(.tlbanner.Left, .tlbanner.top + .tlbanner.Height + 4, .ClientWidth - 20, .ClientHeight - .tlbanner.Height - (.rbNo.Height * 4)) + '.taLicense.Resize(.ClientWidth - (.ClientWidth / 20), .ClientHeight - .tlbanner.Height - (.rbNo.Height * 4)) + .rbNo.Move(.taLicense.Left, .taLicense.Top + (.taLicense.Height + 4), MdlObjSizer.get_object_width(.rbNo.Text) + 24) + .rbYes.Move(.rbNo.Left, .rbNo.Top + (.rbNo.Height + 4), MdlObjSizer.get_object_width(.rbYes.Text) + 24) + END WITH + +END + +PUBLIC SUB rbNo_Click() + + FMain.btnext.Enabled = FALSE + FMain.btnext.ForeColor = Color.Gray + +END + +PUBLIC SUB rbYes_Click() + + FMain.btnext.Enabled = TRUE + FMain.btnext.ForeColor = Color.Black + +END + +PUBLIC SUB tlbanner_MouseDown() + + + +END Added: branches/iVL/FrmLicense.form ============================================================================== --- (empty file) +++ branches/iVL/FrmLicense.form Fri Jul 11 05:03:45 2008 @@ -0,0 +1,23 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,73,60) + Text = ("") + { tlbanner TextLabel + MoveScaled(1,1,71,9) + Text = ("LICENSE AGREEMENT") + } + { taLicense TextArea + MoveScaled(2,19,65,26) + Text = ("TextArea1") + ReadOnly = True + } + { rbYes RadioButton + MoveScaled(2,50,20,3) + Text = ("Yes, I Agree to the License Agreement") + } + { rbNo RadioButton + MoveScaled(2,46,20,3) + Text = ("No, I Do Not Agree") + } +} Added: branches/iVL/FrmPartScheme.class ============================================================================== --- (empty file) +++ branches/iVL/FrmPartScheme.class Fri Jul 11 05:03:45 2008 @@ -0,0 +1,83 @@ +' Gambas class file +' This file is part of vinstall-ng + +' vinstall-ng is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vinstall-ng is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. + + + + +PUBLIC SUB Form_Resize() + + WITH ME + .tlBanner.Width = .ClientWidth - 10 + .rbUseExisting.Move(.tlBanner.Left, .tlBanner.Top + .tlBanner.Height + 8) + .rbEditPartitions.Move(.rbUseExisting.Left, .rbUseExisting.Top + .rbUseExisting.Height + 4) + .tlChoiceExp.Move(.rbEditPartitions.Left, .rbEditPartitions.top + .rbEditPartitions.Height + 16, .tlBanner.Width - 10) + .btNext.Move(.tlBanner.Left + .tlBanner.Width - .btNext.Width - 8, .ClientHeight - (.btNext.Height * 2)) + + END WITH + +END + +PUBLIC SUB Form_Open() + + WITH ME + .rbEditPartitions.Width = MdlObjSizer.get_object_width(.rbEditPartitions.Text) + 24 + .rbUseExisting.Width = MdlObjSizer.get_object_width(.rbUseExisting.Text) + 24 + .btNext.Width = MdlObjSizer.get_object_width(.btNext.Text) + 36 + END WITH + ME.rbEditPartitions.Value = TRUE +FMain.btnext.Enabled = FALSE +FMain.btnext.ForeColor = Color.Gray +END + +PUBLIC SUB rbUseExisting_Click() + + ME.tlChoiceExp.Text = "<b>" & rbUseExisting.Text & "</b><br><br>" & + "Select this option if you already have a linux installation that you wish to overwrite or if a linux partition scheme exists in your " & + "Hard disk. <b>This option will overwrite whatever is in those partitions</b><br><br>" & + "<i>Use this option if you already prepared your partitions using the VectorLinux installer</i>" + +END + +PUBLIC SUB rbEditPartitions_Click() + + ME.tlChoiceExp.Text = "<b>" & rbEditPartitions.Text & "</b><br><br>" & + "Select this option is you wish to create, more or resize partitions in order to make room for your new VectorLinux " & + "installation. This option is the safest choice if you have other existing installations that you wish to keep." + +END + +PUBLIC SUB tlChoiceExp_MouseDown() + + + +END + +PUBLIC SUB btNext_Click() + + IF ME.rbEditPartitions.Value = TRUE THEN + ' fire up the gparted window + FrmDiskPart.Reparent(ME.Parent) + ME.Hide + FrmDiskPart.Show + ELSE IF ME.rbUseExisting.Value THEN + ' Fire wizard to set partitions + ' This will also be used after the user has already partitioned the disk + FrmPartSel.Reparent(ME.Parent) + ME.Hide + FrmPartSel.Show + END IF + +END Added: branches/iVL/FrmPartScheme.form ============================================================================== --- (empty file) +++ branches/iVL/FrmPartScheme.form Fri Jul 11 05:03:45 2008 @@ -0,0 +1,27 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,81,50) + Text = ("") + { tlBanner TextLabel + MoveScaled(1,2,51,4) + Text = ("Select your disk partition option") + } + { rbUseExisting RadioButton + MoveScaled(2,8,32,3) + Text = ("Use existing disk partitions") + } + { rbEditPartitions RadioButton + MoveScaled(2,12,62,3) + Text = ("Modify my disk partitions to make room for new installation") + } + { tlChoiceExp TextLabel + MoveScaled(1,17,76,23) + Text = ("TextLabel1") + } + { btNext Button + MoveScaled(70,44,9,3) + Text = ("Next") + Picture = Picture["icon:/16/right"] + } +} Added: branches/iVL/FrmPartSel.class ============================================================================== --- (empty file) +++ branches/iVL/FrmPartSel.class Fri Jul 11 05:03:45 2008 @@ -0,0 +1,99 @@ +' Gambas class file + +' This file is part of vinstall-ng + +' vinstall-ng is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vinstall-ng is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. + + + + + +PUBLIC SUB Form_Resize() + + WITH ME + .tlBanner.Width = .ClientWidth - 16 + '.frmpartitions.Move(.tlBanner.Left, .tlBanner.Top + .tlBanner.Height + 4, .tlBanner.Width, .ClientHeight - .frmpartitions.top - 4) + '.tlRootPart.Move(.frmpartitions.Left + 8, .frmpartitions.top + 8, MdlObjSizer.get_object_width(.tlRootPart.Text)) + .tlRootPart.Move(.tlBanner.Left, .tlBanner.Top + .tlBanner.Height + 8, MdlObjSizer.get_object_width(.tlRootPart.Text)) + .cbSelRoot.Move(.tlRootPart.Left + .tlRootPart.Width + 8, .tlRootPart.Top) + .btWhatRoot.Move(.cbSelRoot.Left + .cbSelRoot.Width + 8, .cbSelRoot.top, MdlObjSizer.get_object_width(.btWhatRoot.text) + 32) + .bUseCustompart.Move(.tlRootPart.Left, .tlRootPart.top + .tlRootPart.Height + 4) + .tlHomePart.Move(.tlRootPart.Left, .bUseCustompart.Top + .bUseCustompart.Height + 4, .tlRootPart.Width) + .cbSelHome.Move(.cbSelRoot.Left, .tlHomePart.top, .cbSelRoot.Width) + .btWhathome.Move(.btWhatRoot.Left, .cbSelHome.top, MdlObjSizer.get_object_width(.btWhathome.Text) + 32) + .bAllCustom.Move(.bUseCustompart.Left, .tlHomePart.Top + .tlHomePart.Height + 4) + .tlOptPart.Move(.bAllCustom.Left, .bAllCustom.top + .bAllCustom.Height + 4, .tlHomePart.Width) + .cbselopt.Move(.tlOptPart.Left + .tlOptPart.Width + 4, .tlOptPart.top, cbSelRoot.Width) + .tlusr.Move(.tlOptPart.Left, .tlOptPart.top + .tlOptPart.Height + 2, .tlOptPart.Width) + .cbselusr.Move(.tlusr.Left + .tlusr.Width + 4, .tlusr.top, .cbselopt.Width) + .tlvar.Move(.tlusr.Left, .tlusr.top + .tlusr.Height + 4, .tlusr.Width) + .cbselvar.Move(.tlvar.Left + .tlvar.Width + 4, .tlvar.top, .cbselopt.Width) + + + + + + END WITH + +END + +PUBLIC SUB Form_Open() + + ME.tlBanner.Adjust + ME.bUseCustompart.Text = "Use separate partition for user data. (/home)" + ME.bUseCustompart.Width = MdlObjSizer.get_object_width(ME.bUseCustompart.text) + 36 + ME.bAllCustom.Width = MdlObjSizer.get_object_width(ME.bAllCustom.Text) + 36 + + + +END + +PUBLIC SUB btWhatRoot_Click() + + Message("<b>About the root partition</b><br><br>" & + "The root partition is the very top directory on the drive where the operating system is \ninstalled. " & + "This partition contains all the system and application information as well as binaries. \n" & + "<i>This is required for ALL installations</i>") + + +END + +PUBLIC SUB btWhathome_Click() + + Message("<b>About the /home partition</b><br><br>" & + "The /home partition is where the user data is kept. User settings and personal documents \n" & + "are kept here. \n" & + "<i>This is optional, but recommended</i>") + +END + +PUBLIC SUB bUseCustompart_Click() + + IF ME.bUseCustompart.Value = TRUE THEN + WITH ME + .tlHomePart.Visible = TRUE + .cbSelHome.Visible = TRUE + .btWhathome.Visible = TRUE + .bAllCustom.Visible = TRUE + END WITH + ELSE + WITH ME + .tlHomePart.Visible = FALSE + .cbSelHome.Visible = FALSE + .btWhathome.Visible = FALSE + .bAllCustom.Visible = FALSE + END WITH + END IF + +END Added: branches/iVL/FrmPartSel.form ============================================================================== --- (empty file) +++ branches/iVL/FrmPartSel.form Fri Jul 11 05:03:45 2008 @@ -0,0 +1,91 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,72,55) + Text = ("") + { tlBanner TextLabel + MoveScaled(1,1,70,14) + Text = ("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") + } + { tlRootPart TextLabel + MoveScaled(1,17,13,3) + Text = ("Root partition") + Alignment = Align.Normal + } + { bUseCustompart CheckBox + MoveScaled(1,21,37,3) + Text = ("Use separate /home partition") + } + { cbSelRoot ComboBox + MoveScaled(15,17,14,3) + Text = ("") + } + { btWhatRoot Button + MoveScaled(30,17,10,3) + ToolTip = ("What is the root partition?\nClick here to find out") + Text = ("What is this?") + Picture = Picture["icon:/16/question"] + } + { tlHomePart TextLabel + MoveScaled(1,25,12,3) + Visible = False + Text = ("/home") + Alignment = Align.Normal + } + { cbSelHome ComboBox + MoveScaled(14,24,15,1) + Visible = False + Text = ("") + } + { btWhathome Button + MoveScaled(30,24,10,1) + Visible = False + Text = ("What is this?") + Picture = Picture["icon:/16/question"] + } + { bAllCustom CheckBox + MoveScaled(1,29,25,3) + Visible = False + Text = ("Specify additional custom partitions (expoert install)") + } + { tlOptPart TextLabel + MoveScaled(1,33,10,3) + Text = ("/opt") + } + { cbselopt ComboBox + MoveScaled(12,33,12,2) + Text = ("ComboBox1") + } + { tlvar TextLabel + MoveScaled(1,41,10,3) + Text = ("/var") + } + { cbselvar ComboBox + MoveScaled(12,41,11,2) + Text = ("ComboBox1") + } + { tlusr TextLabel + MoveScaled(1,37,9,3) + Text = ("/usr") + } + { cbselusr ComboBox + MoveScaled(12,37,12,2) + Text = ("ComboBox1") + } + { tltmp TextLabel + MoveScaled(26,34,10,3) + Text = ("/tmp") + } + { cbseltmp ComboBox + MoveScaled(37,34,12,1) + Text = ("ComboBox1") + } + { tlWin TextLabel + MoveScaled(26,38,10,3) + Text = ("Win") + } + { cbselwin ComboBox + MoveScaled(37,39,11,1) + Text = ("ComboBox1") + } +} Added: branches/iVL/FrmSelISO.class ============================================================================== --- (empty file) +++ branches/iVL/FrmSelISO.class Fri Jul 11 05:03:45 2008 @@ -0,0 +1,168 @@ +' Gambas class file + +' This file is part of vinstall-ng + +' vinstall-ng is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vinstall-ng is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. + + + + +PUBLIC SUB lstInstallableImg_Click() + + 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 + sLocation = Left(lstInstallableImg.Text, InStr(lstInstallableImg.Text, " ") - 1) + ELSE + ipos1 = RInStr(ME.lstInstallableImg.Text, "/") + sLocation = Right(ME.lstInstallableImg.Text, Len(ME.lstInstallableImg.Text) - ipos1) + END IF + 'function to read the file + ME.DESCRIBE_DISTRO(sLocation) + END IF + END IF + 'Message.Info(File.Load(Temp$(sLocation))) + + + + + +END + +PUBLIC SUB Form_Open() + + + ME.Width = ME.Parent.Width + ME.Height = ME.Parent.Height + FMain.sNextKey = "Prep0" + FMain.FrmCurr = ME + + + + +END + +PUBLIC SUB DESCRIBE_DISTRO(sLoc AS String) + + DIM sFile AS String[] = Split(File.Load(Temp$(sLoc)), gb.NewLine) + DIM sLine AS String + DIM i AS Integer + DIM iSep AS String + DIM ipos1 AS Integer + + DIM sDist, sVer, iMinRoot, iMinHome, iMinSwap AS String + + IF sFile THEN + FOR i = 0 TO sFile.count - 1 + sLine = Trim(sFile[i]) + + IF InStr(sLine, "\'") = TRUE THEN + iSep = "\'" + ELSE IF InStr(sline, "\"") = TRUE THEN + iSep = "\"" + END IF + ipos1 = InStr(sLine, iSep) + IF Left(sLine, Len("DISTRO=")) = "DISTRO=" THEN + sDist = Right(sLine, Len(sLine) - InStr(sLine, "=") - 1) + ELSE IF Left(sLine, Len("VERSION=")) = "VERSION=" THEN + sVer = Right(sLine, Len(sLine) - InStr(sLine, "=") - 1) + ELSE IF Left(sLine, Len("HD_ROOT_MIN=")) = "HD_ROOT_MIN=" THEN + iMinRoot = Right(sLine, Len(sLine) - InStr(sLine, "=") - 1) + ELSE IF Left(sLine, Len("HD_SWAP=")) = "HD_SWAP=" THEN + iMinSwap = Right(sLine, Len(sLine) - InStr(sLine, "=") - 1) + ELSE IF Left(sLine, Len("HD_HOME")) = "HD_HOME" THEN + iMinHome = Right(sLine, Len(sLine) - InStr(sLine, "=") - 1) + + END IF + NEXT + IF Right(sDist) LIKE "\'" OR "\"" THEN + sDist = Left(sDist, Len(sDist) - 1) + END IF + IF Right(sVer) LIKE "\'" OR "\"" THEN + sVer = Left(sVer, Len(sver) - 1) + END IF + + FrmSelISO.tlDistroDesc.Text = "<h3>" & sDist & Space(1) & sVer & "</h3><br>" & + "<b>Minimum Disk Space Requirements</b><br>" + + + IF Right(iMinRoot) LIKE "\'" OR "\"" THEN + iMinRoot = Left(iMinRoot, Len(iMinRoot) - 1) + FrmSelISO.tlDistroDesc.Text = FrmSelISO.tlDistroDesc.Text & "<br>" & "<b>ROOT: </b>" & iMinRoot & " MB" + END IF + IF Right(iMinHome) LIKE "\'" OR "\"" THEN + iMinHome = Left(iMinHome, Len(iMinHome) - 1) + FrmSelISO.tlDistroDesc.Text = FrmSelISO.tlDistroDesc.Text & "<br><b>HOME: </b>" & iMinHome & " MB" + END IF + IF Right(iMinSwap) LIKE "\'" OR "\"" THEN + iMinSwap = Left(iMinSwap, Len(iMinSwap) - 1) + FrmSelISO.tlDistroDesc.Text = FrmSelISO.tlDistroDesc.Text & "<br><b>SWAP: </b>" & iMinSwap & " MB" + + END IF + + + + ELSE + ' can't read file + 'Message.Error("Setup is unable to locate the ") + END IF + + +END + + +PUBLIC SUB btNext_Click() + DIM sSel AS String + sSel = Right(lstInstallableImg.Text, Len(lstInstallableImg.Text) - RInStr(lstInstallableImg.Text, "/")) + PRINT "User selected to install from /dev/" & sSel + 'RETURN + MdlCore.SET_DECISSION(sSel) + WAIT + 'read the SETUP.CONF now to set the variables for the real install process to begin + + +END + +PUBLIC SUB Form_Resize() + + WITH ME + .Reparent(.Parent) + .Resize(.Parent.Width, .Parent.Height) +' .btNext.Move(.Left + .Width - .btNext.Width - 8, .top + ME.Height - .btNext.Height - 8) + .btResCan.Move(.Left + .Width - .btResCan.Width - 8, .top + .tlBanner.Height + 12, MdlObjSizer.get_object_width(.btResCan.text) + 36) + .lstInstallableImg.Move(.left + 4, .btResCan.Top, .Width - (.btResCan.Width + 24)) + .FullScreen = TRUE + END WITH + +END + +PUBLIC SUB btResCan_Click() + +lstInstallableImg.Clear() +MdlCore.MEDIA_SCAN + + +END + +PUBLIC SUB Form_Hide() + + FMain.frmLast = ME + + +END Added: branches/iVL/FrmSelISO.form ============================================================================== --- (empty file) +++ branches/iVL/FrmSelISO.form Fri Jul 11 05:03:45 2008 @@ -0,0 +1,25 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,63,41) + Text = ("") + FullScreen = True + { lstInstallableImg ComboBox + MoveScaled(1,7,45,3) + Text = ("No installable images found.") + ReadOnly = True + } + { tlBanner TextLabel + MoveScaled(1,1,58,5) + Text = ("Select which distribution to install from the list below") + } + { tlDistroDesc TextLabel + MoveScaled(1,13,60,22) + Text = ("TextLabel1") + } + { btResCan Button + MoveScaled(49,7,13,3) + Text = ("Search Again") + Picture = Picture["icon:/16/refresh"] + } +} Added: branches/iVL/MdlCore.module ============================================================================== --- (empty file) +++ branches/iVL/MdlCore.module Fri Jul 11 05:03:45 2008 @@ -0,0 +1,503 @@ +' Gambas module file + +' This file is part of vinstall-ng + +' vinstall-ng is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vinstall-ng is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. + + + + + +PUBLIC sCatPic AS picture = Picture["icon:/16/linux"] +PUBLIC sToDopic AS Picture = Picture["images/circle.png"] +PUBLIC sNowPic AS picture = Picture["images/arrow.png"] +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 + 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 + +END + + +PUBLIC SUB SCAN_LINUX_PARTITIONS() + +DIM sResults AS String +DIM sPartList AS String[] +DIM i AS Integer +DIM sPartition AS String + +'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) + + 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) + NEXT + ELSE ' only one linux partition found + sPartition = Trim(sResults) + ME.SEARCH_LINUX_DRIVES_FOR_MEDIA(sPartition) + END IF + + + + +END + + + +PUBLIC SUB MEDIA_SCAN() + + DIM sCmd AS String + DIM sList AS String + DIM sDrives AS String[] + DIM sDrive AS String + DIM sMountPoint AS String + DIM sDump AS String + DIM i AS Integer + + + + ClsGlobal.sSourceMnt = User.home &/ "mnt" &/ "cdrom" + sMountPoint = ClsGlobal.sSourceMnt + + sCmd = "cat /proc/sys/dev/cdrom/info | grep \"drive name\" |cut -f2 -d\':\'|xargs -n 2" + SHELL sCmd TO sList + sList = Trim(sList) + 'PRINT sList + IF InStr(sList, Space(1)) > 0 THEN 'there is more than one drive + sDrives = Split(sList, Space(1)) + + FOR i = 0 TO sDrives.count - 1 + ' this is where we loop to find SETUP.CONF in the cd + 'first, clear the mount point (using $HOME/mnt/cdrom for now) + sDrive = Trim(sDrives[i]) + + SHELL "sudo mount /dev/" & sDrive & Space(1) & sMountPoint WAIT + IF Exist(sMountPoint &/ "veclinux" &/ "SETUP.CONF") = TRUE THEN + sDump = ME.ID_DISTRO(sMountPoint &/ "veclinux" &/ "SETUP.CONF") + 'save a copy of SETUP.CONF in a temp disposable file + ' this temp file will be named as the last characters of the drive that contains the distro (ie, hda, sg0, sda) + ' this information will be used FOR reading the file later + + File.Save(Temp$(sDrive), DConv(File.Load(sMountPoint &/ "veclinux" &/ "SETUP.CONF"))) + 'Message.Info(File.Load(Temp$(sDrive))) + + IF FrmSelISO.lstInstallableImg.Find(sDump & " on " & "/dev/" & sDrive) = -1 THEN 'only add the entry if not found + FrmSelISO.lstInstallableImg.Add(sDump & " on " & "/dev/" & sDrive) + END IF + + + END IF + SHELL "sudo umount /dev/" & sDrive WAIT + NEXT + + ELSE ' only one drive found + END IF + + + '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 + + + +PUBLIC SUB main() + + ME.MEDIA_SCAN + FMain.Show + 'FMain.tvPlan.MoveTo("Prep0") +FMain.tvPlan["Prep0"].Selected = TRUE + + +' FMain.tvPlan["Prep0"].Selected +END + +PUBLIC FUNCTION ID_DISTRO(sPathToSetupConf AS String) AS String + + DIM sRet AS String + DIM sFile AS String[] + DIM i AS Integer + DIM sLine AS String + DIM sName AS String + DIM sver AS String + DIM isep AS String + + sFile = Split(DConv(File.Load(sPathToSetupConf)), gb.NewLine) + + 'PRINT "Analyzing contents" + FOR i = 0 TO sFile.Count - 1 + sLine = Trim(sFile[i]) + + IF InStr(sLine, "\'") THEN + isep = "\'" + ELSE IF InStr(sLine, "\"") THEN + isep = "\"" + END IF + IF Left(sLine, Len("DISTRO=")) = "DISTRO=" THEN + sName = Right(sLine, Len(sLine) - InStr(sLine, isep)) + + ELSE IF Left(sLine, Len("VERSION=")) = "VERSION=" THEN + sver = Right(sLine, Len(sLine) - InStr(sLine, isep)) + END IF + + NEXT + + IF Right(sName) = isep THEN + sName = Left(sName, Len(sName) - 1) + END IF + IF Right(sver) = isep THEN + sver = Left(sver, Len(sver) - 1) + END IF + + +RETURN sName & Space(1) & sver + + + + +END + + +PUBLIC SUB READ_SETUP_FILE() + + 'This module will read SETUP.CONF and set the necessary variables for the installer to work + DIM sFile AS String[] + DIM sLine AS String + DIM i AS Integer + DIM sDistro AS String + DIM sVer AS String + DIM sBuildDate AS String + DIM iMinRoot AS Integer 'may need to be variant-to-integer + DIM iMaxRoot AS Integer + DIM iMinSwap AS Integer + DIM iMinHome AS Integer + DIM sVal AS String + DIM iPost1 AS Integer + DIM sDelm AS String + + + WITH ClsGlobal +.sBulkDir = .sSourceMnt &/ "veclinux" +.sDocDir = .sSourceMnt &/ "doc" +.sPackDir = .sSourceMnt &/ "packages" +.sReadMePath = .sSourceMnt &/ "README" +.sSetupConfPath = .sBulkDir &/ "SETUP.CONF" +END WITH + + + + + +IF Exist(ClsGlobal.sSetupConfPath) THEN + sFile = Split(File.Load(DConv(ClsGlobal.sSetupConfPath)), gb.NewLine) + FOR i = 0 TO sFile.Count - 1 + sLine = Trim(sFile[i]) + + IF InStr(sLine, "\"") THEN + sDelm = "\"" + ELSE IF InStr(sLine, "\'") THEN + sDelm = "\'" + END IF + IF Left(sLine) <> "#" THEN 'if line is not commented + IF InStr(sLine, "=") THEN 'if there is a "=" in the line + sVal = Right(sLine, Len(sLine) - InStr(sLine, sDelm)) + sVal = Left(sVal, Len(sVal) - 1) + 'PRINT sVal + + END IF + + + END IF + + + 'PRINT sVal + + + IF Left(sLine, Len("DISTRO=")) = "DISTRO=" THEN + sDistro = sVal + ELSE IF Left(sLine, Len("VERSION=")) = "VERSION=" THEN + sVer = sVal + ELSE IF Left(sLine, Len("builddate")) = "builddate" THEN + sBuildDate = sVal + ELSE IF Left(sLine, Len("HD_ROOT_MIN=")) = "HD_ROOT_MIN=" THEN + iMinRoot = sVal + ELSE IF Left(sLine, Len("HD_ROOT_MAX")) = "HD_ROOT_MAX" THEN + iMaxRoot = sval + ELSE IF Left(sLine, Len("HD_SWAP")) = "HD_SWAP" THEN + iMinSwap = sval + ELSE IF Left(sLine, Len("HD_HOME")) = "HD_HOME" THEN + iMinHome = sval + ' BEGIN BULKS HERE *************** + ELSE IF Left(sLine, Len("BULK")) = "BULK" THEN + 'PRINT "bulk" + ClsGlobal.sBulkList = ClsGlobal.sBulkList & "," & sval + ELSE IF Left(sLine, Len("CONF")) = "CONF" THEN + ClsGlobal.sConfPkg = ClsGlobal.sConfPkg & "," & sval + + END IF + NEXT + + 'trim out the list of bulks + IF Left(ClsGlobal.sBulkList) = "," THEN + ClsGlobal.sBulkList = Right(ClsGlobal.sBulkList, Len(ClsGlobal.sBulkList) - 1) + END IF + IF Right(ClsGlobal.sBulkList) = "," THEN + ClsGlobal.sBulkList = Left(ClsGlobal.sBulkList, Len(ClsGlobal.sBulkList) - 1) + END IF + + IF Left(ClsGlobal.sConfPkg) = "," THEN + ClsGlobal.sConfPkg = Right(ClsGlobal.sConfPkg, Len(ClsGlobal.sConfPkg) - 1) + END IF + IF Right(ClsGlobal.sConfPkg) = "," THEN + ClsGlobal.sConfPkg = Left(ClsGlobal.sConfPkg, Len(ClsGlobal.sConfPkg) - 1) + END IF + 'Do something with all of these variables + ' we will need to assign them to the global class +' FMain.lstInstallableImg.Add(sDistro & Space(1) & sVer) + WITH FrmSelISO.tlDistroDesc + .Text = sDistro & Space(1) & sver & "<br>" & + "Build Date: " & sBuildDate & "<br>" & + "<b>MINIMUM REQUIREMENTS<br>" & + "/ " & iMinRoot & "<br>" & + "/home " & iMinHome & "<br>" & + "swap " & iMinSwap + END WITH + ' PRINT sDistro + ' PRINT sVer + ' PRINT sBuildDate + ' PRINT iMinHome + ' PRINT iMinRoot + ' PRINT iMinSwap + ' PRINT ClsGlobal.sBulkList + ' PRINT ClsGlobal.sConfPkg + ELSE + 'File not found + Message.Error("Setup is unable to find SETUP.CONF in your install media. This could be symptoms of a bad burn or a bad ISO") + RETURN ' exit + + END IF + + +END + +PUBLIC SUB SET_DECISSION(sSrcLocation AS String) + + ' This sub will receive a string like "hda") and will read the file in it to + ' set the variables in clsglobal for the one distro that will be installed + DIM sFile AS String[] + DIM sLine AS String + DIM i AS Integer + DIM sFilePath AS String = ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF" + DIM squotetype AS String + DIM sLineVal AS String + DIM iRoot AS Variant + DIM iswap AS Variant + DIM ihome AS Variant + + ClsGlobal.sBulkList = "" + ClsGlobal.sConfPkg = "" + 'drive should already be mounted + 'SHELL "sudo mount /dev/" & sDrive & Space(1) & ClsGlobal.sSourceMnt WAIT + IF Exist(sFilePath) THEN + sFile = Split(DConv(File.Load(sFilePath)), gb.NewLine) + FOR i = 0 TO sFile.Count - 1 + sLine = Trim(sFile[i]) + + IF InStr(sLine, "\"") THEN + squotetype = "\"" + ELSE IF InStr(sLine, "\'") THEN + squotetype = "\'" + END IF + IF Left(sLine) <> "#" THEN 'if line is not commented + IF InStr(sLine, "=") THEN 'if there is a "=" in the line + sLineVal = Right(sLine, Len(sLine) - InStr(sLine, squotetype)) + sLineVal = Left(sLineVal, Len(sLineVal) - 1) + END IF + + IF Left(sLine, Len("HD_ROOT_MIN=")) = "HD_ROOT_MIN=" THEN + iRoot = sLineVal + ELSE IF Left(sLine, Len("HD_SWAP")) = "HD_SWAP" THEN + iSwap = sLineVal + ELSE IF Left(sLine, Len("HD_HOME")) = "HD_HOME" THEN + iHome = sLineVal + ELSE IF Left(sLine, Len("DISTRO=")) = "DISTRO=" THEN + ClsGlobal.DISTRO = sLineVal + ELSE IF Left(sLine, Len("VERSION=")) = "VERSION=" THEN + ClsGlobal.VERSION = sLineVal + + ' BEGIN BULKS HERE *************** + ELSE IF Left(sLine, Len("BULK")) = "BULK" THEN + 'PRINT "bulk" + ClsGlobal.sBulkList = ClsGlobal.sBulkList & "," & sLineVal + ELSE IF Left(sLine, Len("CONF")) = "CONF" THEN + ClsGlobal.sConfPkg = ClsGlobal.sConfPkg & "," & sLineVal + + END IF + + + END IF + + + NEXT + ClsGlobal.iRootMin = CInt(iRoot) + ClsGlobal.iHomeMin = CInt(ihome) + ClsGlobal.iSwapMin = CInt(iswap) + + ELSE 'i can't see the file + Message.Error("Cannot find SETUP.CONF") + END IF +END + + +PUBLIC SUB PREPARE_INSTALL_LAYOUT() +WITH FMain.tvPlan + .Add("Prep", "Preparation", sCatPic) + .Add("Prep0", "Find installation media", sNowPic, "Prep") + .Add("Prep1", "Disk Partitioning", sToDopic, "Prep") + .Add("Prep2", "Regional Setup", sToDopic, "Prep") + .Add("Prep3", "Desktop Selection", sToDopic, "Prep") + .Add("Inst", "Installation", sCatPic) + .Add("Inst0", "Installation Summary", sToDopic, "Inst") + .Add("Inst1", "Install Operating System", sToDopic, "Inst") + .Add("Conf", "System Configuration", sCatPic) + .Add("Conf0", "Computer Name", sToDopic, "Conf") + .Add("Conf1", "System Administrator", sToDopic, "Conf") + .Add("Conf2", "Network Configuration", sToDopic, "Conf") + .Add("Conf3", "User Accounts", sToDopic, "Conf") + .Add("Conf4", "Hardware Configuration", sToDopic, "Conf") +END WITH + +'expand the treeview + FMain.tvPlan.MoveFirst() + REPEAT + FMain.tvPlan.Item.Expanded = TRUE + UNTIL FMain.tvPlan.MoveBelow() + + + + +' ' +' ' DIM sLabel AS TextLabel +' ' DIM X AS Integer +' ' DIM y AS Integer +' ' DIM pPic AS PictureBox +' ' DIM sPrepList AS String = "Find Install Media, License Agreement, Install" +' ' DIM sPrepArr AS String[] = Split(sPrepList, ",") +' ' DIM sCurrStep AS String +' ' DIM i AS Integer +' ' +' ' 'first category +' ' X = FMain.ScrollView1.X +' ' Y = FMain.ScrollView1.y + 4 +' ' FOR i = 0 TO sPrepArr.Count - 1 +' ' sCurrStep = Trim(sPrepArr[i]) +' ' sLabel = NEW TextLabel(FMain.ScrollView1) AS "Preps" +' ' WITH sLabel +' ' '.Width = .Parent.Width +' ' .x = x + 4 +' ' .y = Y + 4 +' ' .Text = sCurrStep +' ' .Width = MdlObjSizer.get_object_width(.Text) +' ' .Height = 27 +' ' +' ' END WITH +' ' y = y + sLabel.Height +' ' NEXT +' ' +' ' +' ' +' ' + + +END + + + + +PUBLIC FUNCTION CALCULATE_SWAP(iRam AS Integer) AS Integer + + DIM iRec AS Integer + IF iRam > 196 THEN + iRec = 512 + ELSE IF iRam > 127 THEN + iRec = 256 + ELSE IF iRam > 63 THEN + iRec = 128 + ELSE + iRec = 96 + END IF + + RETURN iRec + + +END + + + Added: branches/iVL/MdlDiskPart.module ============================================================================== --- (empty file) +++ branches/iVL/MdlDiskPart.module Fri Jul 11 05:03:45 2008 @@ -0,0 +1,77 @@ +' Gambas module file + +' This file is part of vinstall-ng + +' vinstall-ng is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vinstall-ng is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. + + +PUBLIC SUB EMBED_GPARTED() + + + DIM sTitle AS String + DIM aHandle AS NEW Pointer[] + DIM iHandle AS Integer + DIM i AS Integer = 0 + + 'Desktop.Find("", "GParted") + FrmDiskPart.tlBanner.Text = "<h3>Loading gparted .... Please wait</h3>" + SHELL "sudo /usr/sbin/gparted" + WAIT 3 + + sTitle = "GParted" + IF Left(sTitle, 2) = "0x" THEN + iHandle = Val("&" & Mid$(sTitle, 3)) + ELSE IF Left(sTitle) = "&" THEN + iHandle = Val(sTitle) + ELSE + 'aHandle = Desktop.Find(sTitle) + aHandle = Desktop.Find(sTitle) + 'Message.Info(aHandle[0]) + IF aHandle.Count = 0 THEN + REPEAT + WAIT 2 + aHandle = Desktop.Find(sTitle) + INC i + UNTIL + i = 10 OR aHandle.Count > 0 + IF aHandle.Count = 0 THEN + Message("Setup is unable to successfully run gslapt on this system. This may be a sign of \n" & + "a bad install media. Setup cannot continue.") + RETURN + END IF + + ELSE IF aHandle.Count >= 2 THEN + Message("Several windows found. I take the first one!") + ENDIF + iHandle = aHandle[0] + + ENDIF + + 'TRY embEmbedder.Embed(iHandle) + TRY FrmDiskPart.EmbGPARTED.Embed(iHandle) + + IF ERROR THEN Message.Warning(Error.Text) + +END + +PUBLIC FUNCTION FIND_DOS_PARTITIONS(sDev AS String) AS Boolean + + ' this function will find any DOS partitions on the system + ' IF THERE ARE ANY DOS PARTITIONS AFTER THE DISK HAS BEEN MODIFIED, WE'LL NEED TO REBOOT + ' ELSE, THE INSTALLER CAN SAFELY CONTINUE + + +END + + Added: branches/iVL/MdlObjSizer.module ============================================================================== --- (empty file) +++ branches/iVL/MdlObjSizer.module Fri Jul 11 05:03:45 2008 @@ -0,0 +1,41 @@ +' Gambas module file + +' This file is part of vinstall-ng + +' vinstall-ng is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vinstall-ng is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. + + + +PUBLIC fvirtfrm AS Form +PUBLIC datemp AS DrawingArea +PUBLIC SUB get_object_width(sText AS String) AS Integer + + + DIM iRetVal AS Integer + + + fvirtfrm = NEW Form + WITH fvirtfrm + .Width = 300 + .Height = 200 + END WITH + datemp = NEW DrawingArea(fvirtfrm) + + Draw.Begin(datemp) + iRetVal = Draw.RichTextWidth(sText) + Draw.End + RETURN iRetVal + + +END Added: branches/iVL/MdlPartSel.module ============================================================================== --- (empty file) +++ branches/iVL/MdlPartSel.module Fri Jul 11 05:03:45 2008 @@ -0,0 +1,19 @@ +' Gambas module file + +' Gambas module file + +' This file is part of vinstall-ng + +' vinstall-ng is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vinstall-ng is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. + Added: branches/iVL/MdlSetup.module ============================================================================== --- (empty file) +++ branches/iVL/MdlSetup.module Fri Jul 11 05:03:45 2008 @@ -0,0 +1,75 @@ +' Gambas module file + +' This file is part of vinstall-ng + +' vinstall-ng is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vinstall-ng is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. + + +PUBLIC SUB GO_WITH_SELECTED(sDev AS String, sISONAME AS String) ' this will mount the drive and display the license agreement + + DIM sPathToLic AS String = ClsGlobal.sSourceMnt &/ "COPYING" + DIM sAddy AS String = Right(sDev, Len(sDev) - RInStr(sDev, "/")) + + + IF sISONAME OR sISONAME <> "" THEN + 'SHELL "sudo mount " & sDev & " /mnt/loop" WAIT ' will switch places here .. the device will mount to loop and the iso will mount to the mount point + SHELL "sudo mkdir -p /mnt" &/ sAddy & " && sudo mount " & sDev & Space(1) & "/mnt" &/ sAddy WAIT + SHELL "sudo mount -o loop /mnt" &/ sAddy &/ sISONAME & Space(1) & ClsGlobal.sSourceMnt WAIT + + 'SHELL "sudo umount /mnt/loop" WAIT + ELSE + + SHELL "sudo mount -t iso9660 " & sDev & Space(1) & ClsGlobal.sSourceMnt WAIT + END IF + + ' display the license agreement text + FrmLicense.taLicense.Text = SConv(File.Load(sPathToLic)) + + ' This will also set the default variables for distro name and version to clsglobal + MdlCore.SET_DECISSION(ClsGlobal.sSourceMnt) + + +END + + + PUBLIC FUNCTION CHECK_IF_REBOOT_NEEDED() AS Boolean + + ' KNOWN BUG: + ' This will make the user restart if there are FAT* partitions anywhere on the box + ' even if that drive was not modified + ' END OF BUG -- FIX SOON + + DIM sFATList AS String + DIM sFAT32List AS String + + SHELL "sudo probepart | grep -e \"^/dev.*FAT32$\" | sed \'s/\\*/ /\'" TO sFAT32List + SHELL "sudo probepart | grep -e \"^/dev.*FAT$\" | sed \'s/\\*/ /\'" TO sFATList + + sFAT32List = Trim(sFAT32List) + sFATList = Trim(sFATList) + + IF sFAT32List <> "" THEN + RETURN TRUE ' reboot needed + ELSE IF sFATList <> "" THEN + RETURN TRUE ' reboot needed + ELSE + RETURN FALSE ' no reboot needed + END IF + + + + +END + + Added: branches/iVL/Notes ============================================================================== --- (empty file) +++ branches/iVL/Notes Fri Jul 11 05:03:45 2008 @@ -0,0 +1,7 @@ +1. prepare a mount point for cdrom +2. clear mount point +3. find cd drives +4. mount drives one at a time +loop + +TEST Added: branches/iVL/images/arrow.png ============================================================================== Binary file. No diff available. Added: branches/iVL/images/check.png ============================================================================== Binary file. No diff available. Added: branches/iVL/images/circle.png ============================================================================== Binary file. No diff available. |