Monday, February 23, 2015

Put Important Links on Text

I received a private beta invitation for Microsoft's new Skype Translator (it apparently translates conversations live) via e-mail. The problem was that I couldn't figure out how to actually download the program; it didn't auto-activate in either the desktop or Metro client. The e-mail had a link to get Windows 8.1 in case I didn't already have it, but there was no indication of what I should do to get started.

As an aside-that-turned-out-to-be-not-so-much-on-the-side, my e-mail client does not display images in messages to me unless I specifically tell it to. (It's to prevent web beacons from invading my privacy.)

You might be able to see where this is going.

The "get started" link was an image. There was no alt text and no normal text, not even a "click the link below to download", which might have tipped me off to the presence of the invisible link. Once I had the idea to enable the fetching and display of images, I could clearly see the button.

So, web developers, please always have alt text or normal text on critical links. Some people are blind, some don't like images, and most people have an e-mail program that doesn't show external images by default. Let me see the links!

Sunday, February 22, 2015

YouTube, Please Allow "Replace" Reuploads

Today, I discovered that one of the videos I had uploaded to YouTube had somehow gotten something strange done to it in processing and only supports 360p despite having been up for weeks. When I reuploaded it, I got a message saying that I can't upload duplicates of my previous videos. That's really annoying, because I had to wait the entire upload time just to be told they won't accept my video.

I'll probably end up deleting the old one outright and then reuploading, but I propose something better. (Well, I suppose the best solution would be to not butcher my videos when I upload them.) It would be really nice if YouTube would allow duplicate uploads to replace the old, clearing all the metadata - like a delete+reupload, but automatic and without the extra wait.

Saturday, February 21, 2015

FMod - Installable OS

It's possible to boot Windows PE from a hard disk, so I thought it might be kind of interesting to add a means of installing AbiatharOS to the hard drive, thereby allowing persistent changes to be made on the system volume, since it would be a hard disk rather than a RAM disk.

It turns out this was fairly easy to do. There's now an "Install" option on the OS menu, and it's hidden if the flag file indicating a persistent install is present. The presence of this flag also causes the configuration disk chooser to allow the use of the X drive. The installation wizard just prompts for the CD drive letter and the letter of the destination drive. (Good guesses fill in both boxes by default.) Once the user hits "Install", Abiathar invokes ImageX to decompress boot.wim onto the hard drive, then does a bunch of stuff with the BCD store to configure booting.

I tested it (in a VM, of course) and it works every time. It doesn't support UEFI configuration, but I don't know of any real machines (in personal use) that don't have BIOS compatibility in their UEFI implementation. I'm still not sure if anyone will want to use, much less install, this, but I'm learning a lot and having fun.

Friday, February 20, 2015

VBA Script to Search Google for Selected Text in Any Word Version

Though there is a way to tweak Word 2013 to turn the "Search with Bing" context menu option into "Search with Google", neither can be found in Word 2007. So, I wrote a little VBA script to make searching Google from Word's selected text just a keyboard shortcut or mouse click away.

To add this to your Word installation, enable the Developer tab under the advanced options (it's actually under Popular in Word 2007). On it, click Macros. Pull down "Macros in" and choose "Normal.dotm (global template)". Type "SearchGoogle" or any name without spaces into the "Macro name" textbox and click Create. The VBA Editor appears. Paste the following code into it:

Private Declare Function ShellExecute _
 Lib "shell32.dll" Alias "ShellExecuteA" ( _
 ByVal hWnd As Long, _
 ByVal Operation As String, _
 ByVal Filename As String, _
 Optional ByVal Parameters As String, _
 Optional ByVal Directory As String, _
 Optional ByVal WindowStyle As Long = vbMaximizedFocus _
) As Long
Sub SearchGoogle()
 Dim text As String
 text = Selection.text
 text = Replace(text, " ", "%20")
 Dim res As Long
 res = ShellExecute(0, "Open", "http://google.com/search?q=" & text)
End Sub

Click the Save button in the VBA Editor, then close it. Now decide whether you want a keyboard shortcut or a Quick Access Toolbar button for the macro.

If you want a keyboard shortcut, open the options and find the place to configure keyboard shortcuts. (On Word 2007, the button is on the Customize tab. On Word 2013, it can be found at the bottom of the page on the "Customize Ribbon" tab.) Choose Macros from the left list, then the macro you just created on the right. Click on the "Press new shortcut key" box and press the shortcut key you want for this. Save your changes and exit all dialog boxes.

If you want a mouse-accessible button, find the place to customize the Quick Access Toolbar under Word Options. Pull down "Choose commands from" and choose Macros. Select the macro, then click "Add >>" to move it onto the QAT. You can then modify its icon and mouseover text if you'd like, with the Modify button.

You can now use either a keyboard shortcut or a QAT button to search Google for your selected text.

Thursday, February 19, 2015

Secure Your WDS Deployment Share

I discovered today that the Unattend.xml file containing the domain joiner account's password is stored in plain text on a share readable by any domain user. Obviously, that's a problem. Everything I read on the Internet seemed to indicate that that's just how it works and that I should use unsecure domain join (no authentication to domain controller) to avoid storing passwords. I'm not a big fan of that option either, so I messed around with folder permissions a bit.

I determined that it is in fact possible to change the security on the WDS share to allow only administrators and the system to read it. This doesn't break anything - I did a successful unattended deployment after making the change. (The WDS share can be found on the WDS server under the name RemInst.) Secure it!

Wednesday, February 18, 2015

Obscure WDS Bug with Joining Domains on UEFI-Based Systems

Today I ran into a very unusual problem with Windows Deployment Services. I had configured the WDS server to join clients to the domain, but after an unattended install the client was not in fact joined to the domain. After going through all manner of documentation and help forums, I discovered that this is actually a bug with WDS.

If:
  • An unattended deployment is being performed,
  • Without an Active Directory prestaged computer account,
  • On a UEFI-based system,
The client will not join the domain. Instead, I now have to figure out the Microsoft-Windows-UnattendedJoin structure in Windows System Image Manager and try not to send my plaintext password over the wire to the PE client.

(UEFI stands for Unified Extensible Firmware Interface and is a new class of BIOS. Some implementations are really snazzy and support high-color and -res graphics and even mouse input!)

Monday, February 16, 2015

FMod - Working OS

I continued working on the just-for-fun AbiatharOS today, because messing with Windows PE is pretty fun. I discovered that DOSBox won't run under 64-bit WinPE because WinPE has no 32-bit subsystem. So, I switched the image to an x86 32-bit architecture. (If anybody ever makes serious use of this, it'll probably be because their full system doesn't have the power to run Abiathar smoothly, so being 32-bit makes sense.)

However, DOSBox still refused to run. After some investigation with Sysinternals Depends.exe and some hunting for 32-bit versions of the DLLs DOSBox calls for, I managed to get it working in WinPE. The only configuration changes I made were setting CPU cycles per second to 10,000 and enabling IPX. This was done so that the NetKeen files included in the image (with all the Galaxy games and Dreams) would be usable. Portable NetKeen disc, anyone?

I wrote the routine to create the open/save dialog when the normal .NET common dialogs aren't available. It uses P/Invoke and hopefully doesn't leak memory all over the place. (I did find and fix a particularly bad bug with a lack of null-terminator on the end of a string. Hey, I've never written anything in C++.) If possible (i.e. when not running as the PE shell), Abiathar uses a class that just forwards the property accesses to the normal .NET common dialog classes. The two folder browser dialogs that are used are just disabled when running under PE.

On PE startup, Abiathar looks for writable drives on which to place its configuration. If it finds none, it launches DiskPart, prompting the user to format a usable partition and give it a drive letter. If Abiathar can then detect a usable drive, it launches as normal; if not, DiskPart appears again and the user is given the option to shut down. (If multiple suitable drives are found, the user is prompted to choose one.)

In PE mode, an "OS" menu is added to the main menu strip that allows the user to launch a command prompt, start DOSBox, or shut down. (File | Exit is removed in PE mode because it would just cause a reboot.)

This is actually turning into something potentially useful. Of course, it'll need more testing before being declared stable, but Windows PE seems to be holding up pretty well.