Slax author's Blog (RSS)
24
September2012
Windows boot installer
While testing User Access Control turned on in Windows 7 (thanks to Manfred's suggestion) I noticed that the boot installer (to make Slax boot from USB drive) doesn't work at all. Instead, it reports Access Denied or something like that, and the USB is not bootable.
I remembered that OpenELEC solved this somehow thus I learned how they did it and implemented it to the Slax boot installer as well. It is a simple VBS script. If the user has insufficient access privileges, it simply reexecutes the installer from within the VBS script, as administrator. According to wikipedia, VBScript has been installed by default in every desktop release of Microsoft Windows since Windows 98, thus it should be pretty universal solution.
Another important Manfred's suggestion was to discover if the user tries to install the bootloader on the same physical drive where he has windows installed (for example, when the user has one physical harddrive and two partitions on it, c: and d:, then installing Slax on d: would corrupt bootloader for c:). Now this situation is autodetected by another VBS script and the boot installer refuses to continue in such case.
You may want to try it, download this Slax TAR (32bit), put it to your device and run /slax/boot/bootinst.bat as usual. If you put Slax to your system drive or any other partition which shares the boot sector with your windows, it will refuse to install.
The only corner case is probably a situation when the user has windows installed on d: but bootsector on c:, while d: and c: are two different physical drives ... I don't think that this is any usual setup, however I remember that once I had it this way myself on my computer - I wanted to install windows to d: only, but the crappy system automatically installed its bootloader to c:. For such cases, there is no autodetection code since I do not know how to write it. Perhaps if anybody could reuse my vbscripts and rewrite them a bit to support even such case, that would be awesome. For now, the current solution seems sufficient.

User comments


@Lightning:
>> ...first hdd (c:)
Beginning with Vista this isn't true anymore.
Most factory preinstalled Vista/7/8 systems have a small
~100MiB partition which hosts the bootloader whereas the
Windows system files and folders are on a second partion (C:).
Because not all systems are installed this way an installer
has to find out whether the system has been installed to
the first or the second physical partition and whether the
logical drive C: is on the first or sceond partition.
Manfred

Over at porteus, brokenman, fanthom and others found ways around UAC you can check the official porteus installation guide section: Installing Porteus to a USB Flash Drive
in official guide and the section search for UAC . Also brokenman is willing to help in many cases. Thanks Tomas for bringing back Slax! Hope this helps in some way to improve booting on USB devices.

With all respect to fanthom and his fellow campaigners:
They simply disable UAC before installing. Imho this is a
no go and in case of an installer or user failure a high risk
of leaving the users system with UAC staying disabled.
Just my 0.02$
Manfred

Agree with Manfred. The long paragraph at porteus website regarding this is boring, confusing, possibly dangerous and (the main point) completely unnecessary. We can do it better, even without the need for the user to change any settings or even reboot her computer.

For users using windows UAC is a pain in the *.. At least it was in Windows Vista. In Windows 7, it appears to not be that much. Still I prefer to use the Slax cd itself to make a usb bootable. But this is just me! and I am sure many other users will do appreciate your efforts to make things easier to use Slax straight from window$ :)

I'm not sure if I understand. You mean, Slax cd itself, in isohybrid mode to put it to USB device? Or do you mean to just extract Slax CD data to USB and then run bootinst.bat? Because the later is indeed possible, the TAR format is there only for people who can't extract ISO, yet it is the very same data inside.

@tonio:
I'm totally with you concerning UAC.
Nevertheless the problem with switching it off automatically
during an installation is that Tomas would be the one to blame
if something goes wrong whereas the user would be the one to
blame if activated UAC asks him for administrative rights
before installation.

@Tomas
I mean I boot Slax cd itself and insert usb and copy it*
# cp -ra /mnt/slax/* /mnt/usb_mountpoint
then run
# ./bootinst.sh
instead of bootinst.bat which is the one we should use when one uses window$, and copies the data from the cd to the usb device. I have not tried it this out, but from the conversation and the explanation I fully agree with your approaches (yours and Manfred's).
@Manfred
You are right in that the user should be responsible for turning on/off UAC and not hold Tomas accountable for screwing it up when he/she runs it from within window$.
My $0.02

The Slax boot installer (bootinst.bat) can be used in Windows 7 (thumb drive) by right-clicking the bat file and selecting "Run as administrator". No problems with UAC this way..

well iirc windows ALWAYS installs its bootloader and "booting-tools" to the first partition of the first hdd (c:). i guess windows simply isn't able to do it a different way.
i think it would be safe somehow to check, wether there's windows-stuff on c:
Lightning