Jump to content

How to further simplify WinsetupfromUSB


Philster

Recommended Posts

Hi there, this utility is much appreciated. For years now, I have used a DVD unattended install of XP that I created at my work and I have been wanting to convert it over to USB and this worked first time. I'm very impressed.

However the people that use this are users at my work, a lot aren't comfortable with anything that isn't massively simple. The unattended DVD is great as they have to press a key when it starts and then just wait until it has finished.

After using WinSetupFromUSB, upon booting up from the USB you have to choose at the Grub4DOS menu if you want PLoP Boot Manager or Windows XP Setup. Then once you choose Windows XP Setup you get the option of 'First part of Windows XP Pro SP3 setup from partition 0' or 'Second part of XP setup / Boot first internal hard disk'.

I choose 'First part of Windows XP Pro SP3 setup from partition 0' and then when it reboots for the first time I then have to choose 'Second part of XP setup / Boot first internal hard disk'.

Is it possible to automate this bit to some degree to make it simpler for my users?

Many thanks

Phil

Edited by Philster
Link to comment
Share on other sites


Is it possible to automate this bit to some degree to make it simpler for my users?

I guess it is, but since it's "your" users, it is something that *you* should do :whistle:.

I mean, it's not something actually *needed* or a *bug* of some kind, it's a "custom request" that has very little to do with the "main" app thread.

If you start a new thread, posting the actual menu.lst that you have on your USB whatever, I will give you some ideas in which direction to experiment. :)

Essentially it is a "more structured" or "with conditional execution" grub4dos menu.lst, it is possible, but it needs some time (yours ;)) to do the experiments and the checking.

There will be the NEED to write *something* to either the USB whatever or to the actual HD to which the XP is installed/to be installed, in order to "switch" the conditional execution.

:hello:

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Hi Jaclaz

I wasn't anticipating someone would do this for me, but merely tell me if it was indeed possible as per my question and hopefully give me some pointers as it's been many years since I did any unattended work!

Sorry if it is the wrong part of the forum, my bad, where would be better in future?

Thanks for your ideas, I'll get on the case and pop back with the info you suggested later.

Cheers,

Phil

Link to comment
Share on other sites

Hi there, this utility is much appreciated. For years now, I have used a DVD unattended install of XP that I created at my work and I have been wanting to convert it over to USB and this worked first time. I'm very impressed.

However the people that use this are users at my work, a lot aren't comfortable with anything that isn't massively simple. The unattended DVD is great as they have to press a key when it starts and then just wait until it has finished.

After using WinSetupFromUSB, upon booting up from the USB you have to choose at the Grub4DOS menu if you want PLoP Boot Manager or Windows XP Setup. Then once you choose Windows XP Setup you get the option of 'First part of Windows XP Pro SP3 setup from partition 0' or 'Second part of XP setup / Boot first internal hard disk'.

I choose 'First part of Windows XP Pro SP3 setup from partition 0' and then when it reboots for the first time I then have to choose 'Second part of XP setup / Boot first internal hard disk'.

Is it possible to automate this bit to some degree to make it simpler for my users?

Many thanks

Phil

First install, if Windows XP/2000/2003 was added first to the USB disk should be automated.

Key files are default and windefault in root. Grub4dos reads these files to determine which entry is auto selected.

Once you select "First part of Setup..." default entry becomes and remains the second one, "Second part of XP setup...". Changes are saved in windefault file. If you want to perform another setup, you may edit using notepad windefault and without changing anything else in it replace 2 with 1, or simply copy windefault from program directory\files\grub4dos\.

In main menu the file responsible is default and is set to second entry.

More info:

http://diddy.boot-land.net/grub4dos/files/menu.htm#default

Link to comment
Share on other sites

Hi Jaclaz

I wasn't anticipating someone would do this for me, but merely tell me if it was indeed possible as per my question and hopefully give me some pointers as it's been many years since I did any unattended work!

Sorry if it is the wrong part of the forum, my bad, where would be better in future?

Thanks for your ideas, I'll get on the case and pop back with the info you suggested later.

Cheers,

Phil

No, no, it's the "right" Forum :), it's just the wrong thread, if it's OK with you (just post so) I will split your posts to a NEW thread (still in this Forum) BUT named something meaningful like "How to further simplify WinsetupfromUSB install options", in order to "separate" it from the "general" present thread.

(present thread is already 54 pages long, I am trying to avoid it get jammed with several posts that will either represent no interest for a lot of "generic" users or have a lot of relevance for a few "specific" ones)

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

The mechanism through the default file currently implemented assumes that someone "responsible" actually makes the installation and chooses wisely ;) among the options.

http://www.imdb.com/title/tt0097576/quotes

But choose wisely' date=' for while the true Grail will bring you life, the false Grail will take it from you.[/quote']

Each time the USB stick/HD is booted user is presented choices.

The install happens in two "steps", to which it is added a pre-selection for PLoP optional use, i.e.:

  1. PLoP Boot Manager
  2. Windows XP Setup

    1. First part of Windows XP Pro SP3 setup from partition 0
    2. Second part of XP setup / Boot first internal hard disk



      The risk of "automating" the procedure is that if PLoP is needed or the USB stick/HD is used for anything else BUT the install of the XP, user is "locked" inside a kind of loop.
      BUT if the prepared USB stick/HD is used ONLY and EXCLUSIVELY for the XP install you can try reproducing EXACTLY the behaviour of a "standard" XP install CD, with the equivalent of "press any key in 5 seconds to boot from CD" bootfix.bin does on CD/DVD.
      A very basic example of a similar mechanism for grub4dos is given here:
http://www.msfn.org/board/index.php?showtopic=69211&st=26
Of course it can be "complicated" and made prettier by printing text and what not and could also be made "evoluted" in the sense that we can make it check a number of parameters of the actual internal hard disk, like the presence of a partition, of a given "tag" file on it (to make sure that the first part of setup has already been run).
In other words, if we take the PLoP option out, you can have a stick that either:
- Always does "nothing" unless a key is pressed (and boots the internal hard disk normally)
- If the key is pressed starts "First part of the windows Setup" from the USB device
OR:
- Always does "nothing" unless a key is pressed (and boots the internal hard disk normally)
- If the key is pressed starts "First part of the windows Setup" UNLESS it senses it has been already RUN, in which case it does "nothing" as above (and boots the internal hard disk normally)
OR:
. Always starts "First part of the windows Setup" UNLESS it senses it has been already RUN, in which case it does "nothing" as above (and boots the internal hard disk normally) :ph34r:
jaclaz
Link to comment
Share on other sites

Hi jaclaz

Thanks for your kind reply.

Yes, it will be used purely to install XP and nothing else. If it could be the same as the DVD that would be reassuring to the people who will be using it so I'll check that link out you sent.

Today and was encountering the issues you alluded to (not an issue to me of course, but an issue to a non-techie type person) where when it boots up initially you have to manually choose an option i.e. it isn't automated and hence your mention of someone responsible to choose wisely comes into play!

So ideally your last choice is the one I want to get working where it always starts 'First part of Windows setup' unless it has already been run in which case it boots from the hard disk.

Would this involve copying a file onto the hard disk and then checking to see if this file exists? If so where would this checking be done?

Cheers

Phil

Link to comment
Share on other sites

So ideally your last choice is the one I want to get working where it always starts 'First part of Windows setup' unless it has already been run in which case it boots from the hard disk.

Would this involve copying a file onto the hard disk and then checking to see if this file exists? If so where would this checking be done?

There are several ways, copying a file to the internal hard disk may be one way.

A simple conditional check would be enough WARNING! PseudoCODE:

find /somefile.xyz && <do something>

find /somefile.xyz || <do something else>

It would also possible to put directly a signature on some sector of the hard disk, but it is more prone to errors, and it makes thing complex or could create some incompatibility with something else.

There could be a "reversed" way, i.e. write a file on the USB stick *somehow* identifying the PC on which it has been run and have *somehow* grub4dos check this list before choosing the booting entry....:usnsure:

Please note that if you go for the "last choice", until you don't delete that file you won't be able to re-install (if unfortunately needed :() from a USB stick setup this way.

Typical line of reasoning of the "inexperienced user" if he/she actually has free access to the USB stick :ph34r: :

  1. the stupid PC doesnt work
  2. I will re-install Windows ....
  3. this stupid stick doesn't boot
  4. let me re-format it AND run on it any stupid random app I have around
  5. it still doesn't work...
  6. Phiiilster....!

...and you'll have to prepare another stick and delete the file before being able to re-install :whistle:

Please also note, that the solution has to take into account also multiple internal disks, and what not, to be - as much as it can - "foolproof".

A common mistake people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.

jaclaz

Link to comment
Share on other sites

I thought I had cracked this today, but I am being slightly thwarted.

I added a txt file, test.txt, to $OEM$\$1 on my unattended install as these files are put on the C: drive during the text-mode setup before the first reboot.

I then added a line in winsetup.lst as follows:

root (hd1,0)

find /test.txt && default 2

So, on first boot, it doesn't find test.txt and defaults to 1 i.e. start the first part of the install

Upon restart, it boots from USB again, runs the same check, sees that test.txt is present and so defaults to 2 and starts the second part of the install, the GUI phase.

Finally as part of the runonceex.cmd I delete the test.txt from %systemdir%, ask the user to remove the USB key and then restart and all looks perfect.

However, the strange thing I am hoping you can help me on is that test.txt that I originally copied to $OEM$\$1 has disappeared. All the other files are there except this one.

IS there a simple explanation for this? Or can I do it another way? Can I use a copy command in grub and do it that way?

Hope I have made myself clear!

Phil

Edited by Philster
Link to comment
Share on other sites

IS there a simple explanation for this? Or can I do it another way? Can I use a copy command in grub and do it that way?

There may be :unsure: , but definitely it is something that happens NOT in the "grub4dos" part.

grub4dos has NO provisions to write to the filesystem (meaning the filesystem structure), so it cannot delete (or create if that matters) files.

grub4dos has however direct access to disk sectors, so what you can do is write with grub4dos dd a "status byte" to the MBR and later remove it from the booted installed windows with an utility like MBRFIX (called by RunOnceEx or similar) which happens to have exactly this feature.

You can then use the checkrange function to read the byte and use it as "conditional" switch.

Check this thread:

http://www.boot-land.net/forums/index.php?showtopic=12449&hl=

for an example use of checkrange that will also probably be used in next version of WinSetupFromUSBwithGUI.

Or you can dd a whole sector file to an unused sector, say sector 62, and then wipe it with an utility like dsfo/dsfi.

Check this thread for a (complex and seemingly unrelated) example:

http://www.boot-land.net/forums/index.php?showtopic=7138&hl=

grub4dos has also the write command that can write to an already existing file, but it's use seems to me like not suitable for your needs.

Or you can use another way, you can check which files are on the HD after the first part of the windows setup and that are NOT there after second part (because they are deleted by the normal second part of the WinXP install, and check for one of them (this way you won't need the $OEM$\$1).

Out of my head (and without actually checking), I would try checking for the presence of "migrate.inf" :unsure:.

Finally, you can use one sector of the USB thingy or even the actual "F6" firadisk floppy to store this "flag", this way you won't even touch the target HD (though this won't help much in the case of a "stoopid" user that could break the "normal" sequence" - which is the actual only thing that you can "flag" this way).

If this is OK, you can also re-write while booting the .lst file using the mentioned write command.

A simpler way (still at the risk of the "stoopid" user breaking a sequence would be to use the hiddenflag command making use of the second "dummy" partition RMPREPUSB creates, find here some reference:

http://www.boot-land.net/forums/index.php?showtopic=12437&hl=

together with some more examples of the "live dangerously with grub4dos" series ;):

Also, this is grub4dos and NOT "grub" (which doesn't exist, there is GRUB (legacy) and GRUB (2) and grub4dos), though they have several things in common and even a few developers have contributed to two or all three of them, they are DIFFERENT projects and syntax, EXPECIALLY the "advanced" one is different, sometimes slightly, sometimes greatly.

jaclaz

Link to comment
Share on other sites

I used one of the existing files in $OEM$/$1 rather than creating a new one (though I am not sure why this didn't work) and all was fine and it worked perfectly.

So I have just what I need now that should suffice for my users, hopefully even the stupid ones!

So thanks very much for your time and assistance.

No doubt I'll be back if I need more help (very likely!).

Cheers

Phil

Link to comment
Share on other sites

I used one of the existing files in $OEM$/$1 rather than creating a new one (though I am not sure why this didn't work) and all was fine and it worked perfectly.

Good news :thumbup , though it's strange, or maybe it is some "by design" feature from MS, something like "if a file called test.txt - or any file with extension .txt - is found in $OEM$\$1 it is deleted during install". :w00t:

You know, something like having a .txt file beginning with ".LOG":

http://support.microsoft.com/kb/260563/en-us

only not reknown as that one

So I have just what I need now that should suffice for my users, hopefully even the stupid ones!

So thanks very much for your time and assistance.

Only too happy to know there is now another happy bunny in the basket. :)

http://www.msfn.org/board/index.php?showtopic=128727&st=10

jaclaz

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...