Rosario Esposito <[EMAIL PROTECTED]> writes:
> Hello,
> I'm trying to modify the install.pl script (in \dosbin directory)
> because I would like to get only one question during the
> installation: "which percentage of disk space do you want for
> Windows ?".
If you create z:\site\config.pl and put calls to set_value() in it,
they will override the defaults in install.pl. This way, you can
avoid editing install.pl itself, which will make it easier to upgrade
to future releases of Unattended. (Never mind that I have no idea
when I will find time to MAKE another release...)
> I added, in "ask_fdisk_cmds", something like:
>
> print "Choose percentage of disk space for Windows\n";
> my $perc = <STDIN>;
> chomp($perc);
You could use simple_q() instead:
my $perc = simple_q ("Choose percentage of disk space for Windows\n");
> $ret='fdisk /pri:'.$perc.',100';
Looks fine.
> It works fine but it is not an "elegant" solution because:
> - when installation starts it asks me for the percentage of disk space
> for Windows
> - then the disk is partitioned and the system reboots
> - when installation restarts it asks me AGAIN for the percentage of
> disk space for Windows
> - then disk is partitioned but no changing in partition table are
> detected, so the installation goes on
This is an artifact of using DOS to perform the installation. DOS
requires a reboot to recognize the partition table change, but
rebooting erases our memory and makes us start over.
Fixing this is not easy. We cannot store anything in the file system
until after the partition table has been updated; Catch-22.
There are 64 one-bit "flags" in the MBR we could use; they can be
manipulated with the /SETFLAG, /TESTFLAG, and /CLEARFLAG switches to
fdisk. But making this work reliably is tricky, because we have no
guarantee about the values of those flags when the installation
starts. We would have to use multiple bits as a "signature", which
would be clunky because fdisk only allows us to set/test/clear one bit
at a time.
My only suggestion is to change your $ret assignment like this:
$ret = (defined $perc
? 'fdisk /pri:'.$perc.',100'
: undef);
Combined with using simple_q() to set $perc, this will let you press
Enter to skip the partitioning step completely. (I know, this is not
much better.)
In the long run, I would like to move away from DOS, because real
operating systems let you modify the partition table without
rebooting. But this requires a new design and new implementation,
both of which require time.
- Pat
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
unattended-info mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unattended-info