Micro-ISV.asia

Tuesday, 25 November 2008

Change Drive Letters to Make Portable Installations Work Correctly

Filed under: Software Applications — Jan Goyvaerts @ 20:01

AceText, EditPad, RegexBuddy, and PowerGREP have supported portable installations for quite some time. If you’ve already installed them onto your PC, you can create a portable installation via an item in the Help menu. The latest versions come with an installer that has a Create Portable Installation button directly on the installer’s welcome screen (purchased version only). When installed this way onto a USB stick or other removable storage device, you can use these products on any PC, without leaving a trace on that PC. All settings are saved onto the USB stick.

One problem with portable installations is that when you plug your USB stick onto a PC, it doesn’t always get the same drive letter. Unfortunately, our products do not yet detect changing drive letters. This means that Reopen menus (MRU file lists) that list files on your USB stick won’t work when the drive letter changes. Though this certainly doesn’t render the product unusable, it is annoying. Upcoming free minor updates for all 4 products will fix this.

In the mean time, you can resolve this issue by telling Windows which drive letter it should use for your USB stick. This requires administrative privileges. So if you use a portable installation on your locked-down work PC and your home PC, you’ll have to follow the procedure on your home PC, to give your USB stick the same drive letter it automatically gets on your work PC.

The procedure is the same on Windows 2000, XP, and Vista. Here’s a screen shot of how to change drive letters taken on my laptop running Vista.

  1. Plug your USB stick into your PC, if you haven’t already.
  2. Open the Windows Control Panel.
  3. Double-click Administrative Tools in the control panel. You may need to switch the Control Panel to Classic View first to make that icon appear.
  4. Double-click Computer Management.
  5. Click on Disk Management under Storage in the tree view at the left.
  6. Right-click on the volume (drive) you want to change, and select Change Drive Letter and Paths.
  7. In the popup window that appears, select the current drive letter, and click the Change button.
  8. Another popup window appears. Select the drive letter you want from the drop-down list at the right. You can select any drive letter that is currently not in use.
  9. OK the two popup windows.
  10. Repeat the previous 4 steps if you want to change any other drive letters.
  11. Close the Computer Management screen

Windows will automatically remember the drive letter that you assign to each device, and use that drive letter next time you plug in the device. You can assign the same drive letter to multiple devices, as long as they’re not plugged in at the same time. If you plug in two devices to which you previously assigned the same drive letter, Windows will use the next available drive letter for the second device.

This procedure works for any partition on any device, except the partition that Windows boots from. The first thing I do when setting up a new PC is to repartition the hard disk and assign the same drive letters I always use. This way, I can easily synchronize application settings between multiple PCs, without having to worry about different drive letters.

6 Comments

  1. “Upcoming free minor updates for all 4 products will fix this.”

    Out of pure curiosity, are you doing something like this or something more complicated:

    procedure SaveMRU(Files: TStrings);
    var
    ExeDrive, S: string;
    I: Integer;
    begin
    ExeDrive := ExtractFileDrive(Application.ExeName);
    for I := 0 to Files.Count – 1 do
    begin
    S := Files[I];
    if SameFileName(ExeDrive, ExtractFileDrive(S)) then
    Delete(S, 1, Length(ExeDrive));
    //output file name
    end;
    end;

    procedure LoadMRU(FilesAsSaved: TStrings);
    var
    ExeDrive, S: string;
    I: Integer;
    begin
    ExeDrive := ExtractFileDrive(Application.ExeName);
    for I := 0 to FilesAsSaved.Count – 1 do
    begin
    S := FilesAsSaved[I];
    if ExtractFileDrive(S) = ” then
    S := ExeDrive + S;
    //create menu item or whatever
    end;
    end;

    Comment by Chris — Wednesday, 26 November 2008 @ 0:45

  2. We’ll save the MRU list with full paths, and save the drive the exe is on separately. When loading, the old exe drive will be replaced with the new exe drive.

    Comment by Jan Goyvaerts — Thursday, 27 November 2008 @ 1:37

  3. Thanks for the info. Although I wrote support for changing drive letters for my products, too, I never had an idea that it was possible to reconfigure them. It’s *really* hidden….

    Thomas

    Comment by Thomas Holz — Monday, 1 December 2008 @ 18:46

  4. I’ve often tried to reconfigure the drive letters which windows gave them, but I’ve never found something that was able to solve this problem. And that’s why I couldn’t install some programmes on my pc. So I really have to thank you for this information. It’s so helpful.

    Comment by Amanda Ketten — Wednesday, 10 December 2008 @ 15:38

  5. Thanks for an excellent post. Have to agree with Thomas Holz. Had no idea this was possible to do. Hidden with Capital H. Thanks from Matt.

    Comment by Mathias Ahlgren — Wednesday, 10 December 2008 @ 23:25

  6. for command line, see the diskpart utility
    http://support.microsoft.com/kb/300415

    Comment by Peter T — Thursday, 1 January 2009 @ 23:34

Sorry, the comment form is closed at this time.