24

September
2012

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