Category Archives: Software

Unknown Undo/Redo Error

This happened to me couple a days ago using Visual Studio .NET 2003 developing an old ASP.net application in Windows  XP Mode. Using product released 9 years ago on a newer OS has it’s charms.

Unknown undo / redo error.

How to fix it: Re install the IDE ( on 2 out of 3 machines this seems to resolve the problem )  or better, upgrade your project to more recent version of Visual Studio and enjoy all the benefits. As for the company I work for we finally did the upgrade ( Visual Studio 2010 )

Windows 7 USB installation

Due to the enormous amount of software installs and uninstalls I decided it’s about time to reinstall my desktop machine. Having no spare DVD around my installation media of choice was a USB key.

Installing windows 7 from USB key is quite fast actually. Here is how to prepare Windows 7 bootable USB.

The requirements
NOTE: My installation was Windows 7 Professional SP1 x64. After completion of this process the space occupied on the USB key was 3,11 GB.

You will need a flash drive around 4 GB, an ISO image or DVD of Windows 7 and a machine running Windows XP or later. Also an archive tool able to extract ISO files. I use 7-Zip.

Preparing the installation media

1. Formatting the USB drive
Plug in the USB memory stick, right click on the drive in ‘Computer’ and select ‘Format…’. I recommend doing complete format by removing the check box next to ‘Quick Format’ option.

format

Depending on the drive size and speed the format will take some time.

2. Making the USB drive bootable
For this step we will use a command line utility called Diskpart. It’s bundled with every Windows version from 2000 onward.

To start Diskpart, click on the Start button and type diskpart. The diskpart utility will appear. Give it some time to load and enumerate your drives.

NOTE: For complete list of commands that the utility supports type: help at the DISKPART> command prompt.

diskpart1

To list your drives type list disks. From the list of your drives find the USB stick by comparing the size of the drive with the size of your USB stick. In my case the flash drive was ‘Disk 3’

Untitled3

At the ‘DISKPART>’ command prompt select your USB drive by entering the following command where # is the drive number of your flash drive:

DISKPART> select disk #

Now type in the following sequence of commands:

DISKPART> clean
DISKPART> create partition primary
DISKPART> active

Close the utility by typing:

DISKPART> exit

Your flash drive is now bootable. It’s time to copy the windows installation files on it.

3. Coping the Windows 7 installation

Extract the Windows 7 iso image to a location of your choice. If you are using 7-zip right click on the .iso image select 7-zip and from the sub menu select ‘Extract files…’

NOTE: If you are turning Windows 7 DVD in to a bootable Flash drive installation just copy the contents of the DVD on the flash drive.

Untitled7

Copy the contents of the extracted .ISO file on your USB drive as you normally would.

Untitled8 
Now you have a bootable Windows 7 installation. Restart your computer and set it to boot from the USB. Install Windows 7 as you normally would.

This method is applicable also for Windows 2000, XP and Vista.

Word Press “Import RSS” Plugin

I just imported my old blog that dates back to 2005 trough the “Import RSS” plugin and I must say i’m impressed. The plugin created categories for the posts and event the images were imported.

All you have to do is: retrieve your old blog RSS 2.0 feed, save it some where, and let the plugin knows where it is by clicking the “Upload” button. The RSS import plugin is located under Tools->Import in the admin panel.

Heroes III on GNU/Linux

UPDATED: 18.07.2014

I’m long time fan of Heroes Of Might and magic series. Especially Heroes III. Today I decided to spend some time playing it on my OpenSUSE box.

This article is not about running Heroes III under Wine, it’s about installing the GNU/Linux version produced by Loki Software years ago, under modern GNU/Linux distribution.

heroes3-gnu-linux-opensuse12.3

1. Get a copy of the game. Since Loki is no more, the game cannot be ordered from them, but there are chances that some copies are still available on eBay or other online store. Google “Heroes III Linux”, for other ways of obtaining the software.

2. Download the latest patch (1.3.1) from here.

3. Install the game.

This step requires “root” privileges on the system. Open a terminal and become super user by typing

su

or

sudo -i

hitting the Return key and providing you password.

NOTE: You may install the game as your normal every day user. It will be installed in your home directory, and only playable by you, or the users from the “users” group. Depends on how your system is configured.

If you are installing from CD, mount it

cd

to the mount point and run

sh setup.sh

This will start the game installation process. Follow the onscreen instructions.

If during the execution of the a bought command you get error message like the one below:

This installation doesn’t support glibc-2.1 on x86_64 Please contact Loki Technical Support at support@lokigames.com

you are trying to install the game on a 64-bit GNU/Linux distribution. To start the setup program type:

linux32 sh setup.sh

During the setup process you will be asked what part’s of the game you want installed on your hard drive and witch one the game should look for on the CD. I recommend full game installation. This can be achieved by answering Y on the following questions:

Install Base Install? [Y/n] Y
Install Scenarios? [N/y] Y
Install Sounds and Graphics? [N/y] Y
Install Music? [N/y] Y
Install Videos? [N/y] Y

4. Applying the patch.

The patch downloaded in step 2, is the latest patch for the Linux version of Heroes III. It fixes some game play bugs like playing the game on full screen. To install the patch:

4.1 Open a terminal, and go to the folder containing the file heroes3-1.3.1a-unified-x86.run. Become a super user (see step 3) and type

chmod +x heroes3-1.3.1a-unified-x86.run
./heroes3-1.3.1a-unified-x86.run

After executing the a bough commands you probably will get the following error:

Verifying archive integrity...OK
Uncompressing Heroes of Might and Magic III 1.3.1a Update......................................tar: A lone zero block at 12620

./update.sh: line 56: loki_patch: command not found
The program returned an error code (1)

As the error message says the loki_patch command is not found. To overcome this problem, download loki_patch from here and save it in the directory where you downloaded heroes3-1.3.1a-unified-x86.run.

Make it executable by typing:

chmod +x loki_patch

Now it’s time to extract our HoM III update. Run the following command:

./heroes3-1.3.1a-unified-x86.run --keep

The installer will fail with the error mentioned previously, but passing the –keep parameter to the patch executable, forced the installer to keep the update files. Type ls to see the directory listing. You should have a directory called heroes3-1.3.1a-unified-x86. Our task is to replace the loki_patch version contained within the update with the one we have downloaded. Execute the following sequence of commands to replace loki_patch and start the update process.

cp loki_patch heroes3-1.3.1a-unified-x86/bin/Linux/x86/loki_patch
chmod +x heroes3-1.3.1a-unified-x86/bin/Linux/x86/loki_patch
chmod +x heroes3-1.3.1a-unified-x86/update.sh
./heroes3-1.3.1a-unified-x86/update.sh

For 64-bit GNU/Linux distro run:

linux32 ./heroes3-1.3.1a-unified-x86/update.sh

Follow the onscreen instructions. Close your root session by typing exit.

The game is now installed and patched to the latest version available.

NOTE: If during the installation of the patch you get ERROR: No matching delta for /usr/local/games/Heroes3/heroes3.dynamic don’t worry, the patch is installed. You can verify it by executing heroes3 -v. The output should says:

Heroes of Might & Magic III 1.3.1a

Type heroes3 and press enter to start playing. Type heroes3 –help, to view the available command line options, or review them below.

Heroes 3 command line options.

# heroes3 --help
Linux version by Loki Software, Inc.
http://www.lokigames.com/
Support - FAQ: http://faqs.lokigames.com/
          Web: http://fenris.lokigames.com/

          E-mail: support@lokigames.com
          Phone:  1-714-508-2140 (9-5 PM US Pacific Time)

Usage: heroes3 [options]
     [-h | --help]           Display this help message
     [-v | --version]        Display the game version
     [-f | --fullscreen]     Run the game fullscreen
     [-w | --windowed]       Run the game in a window
     [-s | --nosound]        Do not access the soundcard
     [-c | --nocdrom]        Do not access the CD-ROM
     [-u | --update]         Run the Loki auto-update tool
     [-q | --qagent]         Run the Loki QAgent support tool
     [-x | --x11cursor]      Use the X11 hardware mouse cursor
     [-l | --logging]        Enable logging

You can use the HEROES3_DATA environment variable to force the
Heroes III installation directory

NOTE: -u | –update and -q | –qagent does not work!

5. Known problems with the game.

There are some known problems with the game on modern GNU/Linux distributions as follows:

* No sound.

When starting the game you may see the following error:

Couldn't open audio:

The solution to this problem varies from distribution to distribution. Please consult your distro community. In some cases the sound just works.

* Random game crashes.

Sometimes the game may crash. It’s useful to start the game with the -l option, to enable logging. The log files are stored under ./home/<username>/.loki/heroes3.

6. Adding custom maps

Custom maps can be installed by copying them to .loki/heroes3/maps (available only for the current user) or in <game installation folder>/maps (available for all the users).

NOTE: <game installation folder>, by the means of this tutorial is /usr/local/games/Heroes3.

Happy adventuring :) . Tutorials about installing other Loki Software products will be available soon.

Restoring deleted files when you have emptied the Recycle Bin

I like to experiment, and last night I was playing with a Powertoy from MS called SyncToy (very useful utility if you ask me, another review feauturing SyncToy is on it’s way). So now on the topic.

While experimenting with SyncToy, I accidently deleted some documents form my workstation computer and my laptop. The files were putted in the Recycle Bin, on both PC’s but, without any hesitation I emptied the Recycle Bin folders. Some moments later I realized what I have done and start thinking of a way to recover my documents. After searching Help And Support center for a while, and when nothing useful showed up, I started Firefox and asked Google about “Recovering Deleted Files from Recycle Bin”, the first result that showed up was this page, containg a link to very useful utility called Restoration, I downloaded the utility, checked the archive with my AV just in case and then unpack it.

Restoration does not require installation and it’s MFC application. Supports FAT32 and NTFS file systems and it’s written by Brian Kato.

Restoration utility
Restoration utility. Click on the image to view the actual size

To restore a file with the Restoration utility:

  1. From the right pane select the drive from which the file were deleted.
  2. If you want to view all the files deleted from this hard drive click on “Search Deleted Files”, or if you are searching for something specific, type the name of the file in the box above the mentioned button and then click it.
  3. Select the file from the list and click “Restore by Copying”. Save dialog will pop up asking you where you want to save the file. Choose location and click the Save button.
  4. Enjoy your restored file :)
Restoration utility
Restoration utility in process of restoring a file. Click on the image to view the actual size.

Restoration utility can be downloaded from here. The license of the application is freeware and according to my AV the archive is safe.