My blog has moved!

You should be automatically redirected in 6 seconds. If not, visit
http://kavachai.com
and update your bookmarks.

Thursday, October 22, 2009

Updating Application That Has Custom Actions in Setup.dll

Recently I was creating installer for application that is suppose to be updated regulary. Also cab installer for this application used setup.dll to perform custom actions during install/uninstall.

Since cab installer doesn't have "update" feature installing update is done as a sequence: uninstall_old > install_new. Calls to setup.dll will be as follows:
  1. Install_Init() from new setup.dll is called with fFirstCall=true and fPreviouslyInstalled=true.
  2. Old installation is removed. This leads to calls to Uninstall_Init() and Uninstall_Exist() from old setup.dll (which is stored in \windows\AppMgr).
  3. Install_Init() from new setup dll is called with fFirstCall=false and fPreviouslyInstalled=false.
  4. New files are extracted by cab installer.
  5. Install_Exist() is called.
To control updating process I needed to use some kind of a marker that will be available at all of those steps.
Originally I tried to use named Mutex (mainly because it is an in-memory object), but for some reason it didn't work as expected. So I considered key in registry and a file. Creating/removing file just to use it as a marker is not very good idea and my final solution was to use a key in registry:
#include <windows.h> 
#include <string.h>

///////////////////////////////////////////////////////////
// Methods to work with marker.

void SetInstallingStartFlag() {
HKEY hKey = NULL;
DWORD dwDisposition;
if (::RegCreateKeyEx(HKEY_CURRENT_USER, _T("\\SOFTWARE\\MySoftwareInstall"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS) {
::RegCloseKey(hKey);
}
}
void RemoveInstallingStartFlag() {
HKEY hKey = NULL;
if (::RegOpenKeyEx(HKEY_CURRENT_USER, _T(""), 0, KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS) {
::RegDeleteKey(hKey, _T("\\SOFTWARE\\MySoftwareInstall"));
::RegCloseKey(hKey);
}
}
BOOL OpenFlagKey() {
BOOL bOpened = FALSE;

HKEY hKey = NULL;
if (::RegOpenKeyEx(HKEY_CURRENT_USER, _T("\\SOFTWARE\\MySoftwareInstall"), 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
bOpened = TRUE;
::RegCloseKey(hKey);
}

return bOpened;
}
BOOL IsRemovingDuringUpdate() {
return OpenFlagKey();
}
BOOL IsInstallingDuringUpdate() {
return (OpenFlagKey() == FALSE);
}


///////////////////////////////////////////////////////////
// Setup.dll interface methods and enums.

typedef enum {
codeINSTALL_INIT_CONTINUE = 0,
codeINSTALL_INIT_CANCEL
}
codeINSTALL_INIT;

typedef enum {
codeINSTALL_EXIT_DONE = 0,
codeINSTALL_EXIT_UNINSTALL
}
codeINSTALL_EXIT;

typedef enum {
codeUNINSTALL_INIT_CONTINUE = 0,
codeUNINSTALL_INIT_CANCEL
}
codeUNINSTALL_INIT;
typedef enum {
codeUNINSTALL_EXIT_DONE = 0
}
codeUNINSTALL_EXIT;

extern "C" __declspec(dllexport) codeINSTALL_INIT Install_Init(HWND hwndParent, BOOL fFirstCall, BOOL fPreviouslyInstalled, LPCTSTR pszInstallDir) {
if (fFirstCall == TRUE) {
SetInstallingStartFlag();
}

return codeINSTALL_INIT_CONTINUE;
}

extern "C" __declspec(dllexport) codeINSTALL_EXIT Install_Exit(HWND hwndParent, LPCTSTR pszInstallDir, WORD cFailedDirs, WORD cFailedFiles, WORD cFailedRegKeys, WORD cFailedRegVals, WORD cFailedShortcuts) {
BOOL bUpdating = IsInstallingDuringUpdate();
RemoveInstallingStartFlag();

if (bUpdating == TRUE) {
// Run updating code here...
}
else {
// Run installation code here...
}

return codeINSTALL_INIT_CONTINUE;
}

extern "C" __declspec(dllexport) codeUNINSTALL_INIT Uninstall_Init(HWND hwndParent, LPCTSTR pszInstallDir) {
BOOL bUpdating = IsRemovingDuringUpdate();
RemoveInstallingStartFlag();
if (bUpdating == FALSE) {
// Run uninstallation code here...
}

return codeUNINSTALL_INIT_CONTINUE;
}

extern "C" __declspec(dllexport) codeUNINSTALL_EXIT Uninstall_Exit(HWND hwndParent) {
return codeUNINSTALL_EXIT_DONE;
}

Tuesday, October 20, 2009

Linkpool: TortoiseSVN and Password to SVN

TortoiseSVN does not allow save password to SVN. This forces entering it many times during the day. Fortunately there is a workaround and Ditching the Password Prompts in TortoiseSVN explains how.

Thursday, October 15, 2009

What is MaxBuild Property in .inf File for Cabwiz is Actually For

When installing cab file on devices that have square screens or support screen rotation (last is applicable to all devices starting from WM 2003 SE) you may receive an error message:
The program you have installed may not dispay properly because it was designed for a previous version of Windows Mobile software.
Text of this message is not really correct because actually cab installer complains about screen on WM, not OS version.
To omit this error MaxBuild property declared in Vestion section of .inf file can be used. According to Microsoft:
The BuildMax value can be used to indicate that the application supports square screens (BuildMax=0xA0000000), screen rotation (BuildMax=0xC0000000), or both (BuildMax=0xE0000000).
This is one of those odd things that we can found in sometimes. Error message leads us to wrong direction and name of property doesn't have any connection to what it does :)

Wednesday, October 14, 2009

Hard Reset HTC S730

Yesterday HTC S730 that I use for development hang and after soft reset I couldn't start it again.
So I had to perform hard reset using special key combination: holding both soft buttons press power button. At first it didn't work. After spending couple of minutes on Internet I found that there is a trick: power button must be pressed only for a second and then released.
After very first try I successfully reset the phone :)

Tuesday, October 6, 2009

Linkpool: UI design

Today I watched a video of Ryan Singer from 37sygnals that I want to share about:
  • UI Fundamentals for Programmers: great presentation about UI fundamentals that covers such aspects of UI design as thinking about model, actions and differentiation of information instead of sets of fields and forms.
  • This video reminded me another Ryan's presentation at FOWD. I would recommend watch the first one and then first 5 min from FOWD video plus last 15 min (starting at 34th min).

Friday, October 2, 2009

Hiding Applications to Tray

Last week I found great utility called TrayIt! that allows to hide applications to tray when instead of minimizing to taskbar.
It has very simple interface and works stable. I use it to hide Outlook Express and Lotus Notes.

P.S.
There is also utitlity specially for OutlookExpress (HideOI).

Race to Market Challenge



Commercial of Microsoft's analog of AppStore.

Zen Image for Developers

Thursday, October 1, 2009

Remote Controller for Windows Mobile Devices

Couple of years ago when I was developing for Windows Mobile devices I used Pocket Controller as remote controller. It costs money but we had licenses for it.
Recently I joined Excitor company as WM client developer and had to find freeware alternative to Pocket Controller. I found great application EveryWAN Remote Support. It has free personal edition with the only limitation: device has to be connected to desktop via ActiveSync using USB or Bluetooth. It's OK for development purposes, so EveryWAN Remote Support Personal Edition is a great replacement of Pocket Controller.

Saturday, September 26, 2009

Disabling MSN in Outlook Express

When Outlook Express starts it automatically starts MSN. But there is a way to stop this behavior:
  1. Start Registry Edit (Click Start, then Run, type in 'regedit' and click OK).
  2. Go to HKEY_LOCAL_MACHINE > Software > Microsoft > Outlook Express .
  3. Create new DWORD value with name "Hide Messenger" and set value to 2.
Now you just need to stop MSN, and restart Outlook Express. You will see that MSN Messenger no longer appear.

Tuesday, September 15, 2009

A Reminder of Who We Should Be

Just saw an excellent quote of George Bernard Shaw saying how active people behave:
"The people who get on in this world are the people who get up and look for the circumstances they want, and, if they can't find them, make them."


Linkpool: .Net Compact Framework

Today I need to refresh my knowledge of developing for Windows Mobile. So I surfed through my favorites tagged as Compact Framework and here is what I found:


Both articles are concentrated on older versions (1.0 and 2.0), but they still a good place for those who just need refresh knowledge or start developing for Windows Mobile.

Monday, September 7, 2009

Have you tried turning it off and on again?

"Turn it off and on again" is almost as canonic recipe as "Ctrl-Alt-Del". Here is an excellent video about first from "The IT Crowd" series:

Tuesday, August 4, 2009

Bjarne Stroustrup's wish came true

Yesterday I saw a quotation of Bjarne Stroustrup:
I have always wished that my computer would be as easy to use as my telephone.
My wish has come true.
I no longer know how to use my telephone.

To my mind this three sentences show that sometimes marketing people can turn even the simplest thing to a swiss knife. And these electronic swiss knifes are not so intuitive in use.

Linkpool

I'd like to share some stuff that I read/listen recently:


I believe this post will be a start of regular sets of articles that I find really exciting and interesting.

Thursday, July 30, 2009

Installing & uninstalling applications on emulator

Story 1. Installing application.
To install application to emulator adb utility will be handy:
  • Start emulator.
  • Open command prompt (cmd.exe).
  • Navigate to "tools" directory in Android SDK.
  • Run installation using command "adb install application.apk". For example, "adb install "C:/com.andreware.sample.apk"" when com.andreware.sample.apk is located at root directory on disk C.
  • Wait couple of seconds while application is being installing.

Story 2. Uninstalling application.
There two ways to uninstall application from emulator: uninstall like on real device or use adb utility. First way allows to uninstall any application while adb utility will allow to uninstall only application installed using it (including the ones deployed from IDE).
Let's look at first one first. It is pretty simple and straitforward:
  • Start emulator.
  • On the home screen press the "Menu" button.
  • Choose"Settings" item from menu.
  • Choose "Applications" item in the settings list.
  • Choose "Manage applications".
  • Choose application that you want to uninstall.
  • In the "Application info" window that will appear click "Uninstall" button.
  • Confirm uninstalling.
  • Wait a second while application is being uninstalling and click "OK" on next window that says "Uninstall finished".
Second way requires usage of command line and adb utility:
  • Start enulator.
  • Open command window (cmd.exe).
  • Navigate to "tools" directory in Android SDK.
  • Run remote shell: "adb shell".
  • Goto app directory: "cd /data/app".
  • Now you can list installed applications: "ls".
  • To uninstall application use "rm" command and appropriate apk file. For example, "rm com.andreware.sample.apk".
  • Type "exit" to leave remote shell.

Using Android standard icons in designer

Today I wanted to use standard search icon on one of the buttons. When I want to use custom icon I use Reference Chooser dialog. As a result I have such a reference in a property:
@drawable/search_icon
But Reference Chooser dialog does not provide a way to use standard icon (or I don't see it). Fortunately we can type reference directly to property value either in designer or plane xml. So to use standard drawables "@android:drawable/id" pattern can be used. For example, to set standard search icon I used this reference text:
@android:drawable/ic_menu_search

Wednesday, June 17, 2009

Setup Eclipse for BlackBerry Storm development

I've spent many hours trying to install BlackBerry plug-in v4.7 (needed to develop for Storm) on Eclipse and finally I found solution. As always solution was in one small detail. Here is the whole way to setup environment.

INSTALL J2SE
Download and install Java SE Development Kit. Personally I used JDK, but I think JRE should work as well.

INSTALL ECLIPSE
Download and install (actually unpack) Eclipse IDE for Java Developers if you don't have one. I must say that BlackBerry plug-in for Eclipse contains this IDE, but who knows what version did they pack into plug-in installer.

DOWNLOAD COMPLETE ECLIPSE SOFTWARE UPDATE
Once you checked that your Eclipse is working you need to install BlackBerry Eclipse plug-in. Go to BlackBerry JDE Plug-in for Eclipse and download Full Installer and Eclipse Software Update for the BlackBerry JDE v4.7 Component Pack.

INSTALL ECLIPSE BLACKBERRY PLUGIN
Install plug-in from Full Installer first. It will ask you to install new Eclipse or specify existing one. Just point to your Eclipse folder and proceed installation process.
Since Full Installer does not provide you with Storm emulator and v4.7 platform you need to install v4.7 Component Pack. RIM web site suggests to install this update using update site. Don't do it. If you already tried to go this as discribed in instructions you will need to perform step 4. Here is correct way to install update:
  1. 1. Run Eclipse
  2. 2. Go to Help > Software_Updates
  3. 3. Switch to Available_Software tab
  4. 4. Make sure that you don't have a link to "http://www.blackberry.com/go/eclipseUpdate" there. If you have follow step 4.1 otherwise jump to step 5.
    • Remove link to RIM update site using Manage_Sites button.
  5. 5. Add new site like this:
    • Click Add_Site button.
    • Click Archive button and select update file downloaded earlier.
    • Click OK.
  6. 6. Check this new node in the list of available software and click Install button.
  7. 7. Follow instructions in installer.

SETUP ECLIPSE TO USE BLACKBERRY 4.7 JDK
Now you will have 4.7 installed, but not set as default. You need to change default component from 4.5 to 4.7.
To do so you need to:
  • Create new workspace and add BlackBerry project (File > New > Project and pick BlackBerry project).
  • Go to BlackBerry > Configure_BlackBerry_Workspace in Eclipse main menu.
  • Navigate to BlackBerry_JDE > Installed_Components
  • And change component from 4.5 to 4.7

That's it. Now you can start playing with Eclipse environment for BlackBerry.

P.S.
There are some problems with simulator under Eclipse. I wrote about this in BlackBerry simulator in Eclipse could work better.

There is no "enum" keyword for BlackBerry

In one of projects I'm working on I needed to port some code from Android to BlackBerry platform. As part of implementation for Android I used enumeration.
As I saw there is no "enum" keyword for BlackBerry. That was hard to understand since I like enums as a natural way to group constants. Anyway I had two options: use simple constants or design a class. I decided on the second one.

So for enum that looks like this:
enum Numers {
Odd, Twin;

public int toInt() {
return (this == Odd) ? 0 : 1;
}

public static Numbers fromInt(int value) {
return (value == 0) ? Odd : Twin;
}
}
I used class like this:
class Numbers {
public static Numbers Odd = new Numbers(0);
public static Numbers Twin = new Numbers(1);

private int _value;

private Numbers(int value) {
_value = value;
}

public int toInt() {
return this._value;
}

public static Numbers fromInt(int value) {
return (value == 0) ? Odd : Twin;
}
}
Not so natural as with "enum" keyword, but good enough :)

BlackBerry simulator in Eclipse could work better

Yesterday I finally installed BlackBerry plug-in for Eclipse, but I'm disappointed by simulator integration with IDE.

For some reason BlackBerry simulator does not do it's best when developing using Eclipse. Most of the time I cannot run application twice from Eclipse. I have to restart simulator for second attempt to run my app.

It takes some time. So I found a faster workaround. When I see this kind of problem I:
  • rebuild project (Alt+B)
  • manually delete application from simulator (Select app in Downloads; Menu > Delete; Click Delete to confirm)
  • manually load application to simulator (File > Load_Java_Program from simulator menu)

This is much faster then restarting simulator every time problem occurs.

Unfortunately this works only when I don't need to debug code. I still have to restart simulator when debugging.

Thursday, June 11, 2009

External web camera can break your VMWare

Be careful with web cameras and VMWare. This string I needed to buy and install web camera since my laptop doesn't have one. And this simple step led to problems with using VMWare Workstation.
Luckily there a simple fix for the issue found at VMWare Communities:
1) Dont play or install any VMware Software.
1) After installation search for FixCamera.exe and delete it. (generally installed in folder Windows).
2) Run msconfig (I have Windows XP SP2) and in the Start tab, uncheck FixCamera.
My Web Cam's software still works fine without FixCamera.exe

Monday, June 1, 2009

Funny and scaring usage of exceptions

I've just read post The Greatest Exception Handling WTF?!? of All Time.
It's about missusing exceptions in application code. Guy uses exception to return value from method, but usage of this method is even funnier:

the page code that uses the method actually requires the the returned exception to be thrown in order to fulfill its normal function.

Friday, May 22, 2009

How to bring back "File Explorer" window in Eclipse DDMS

I accidentally closed File Explorer in DDMS view in Eclipse. Unfortunately I couldn't just use context menu to bring it back. It takes a longer way to fix such a mistake.

You'll have to do this using main menu:
  • Window > Show View > Other...
  • Under "Android" node there is "File Explorer"
  • Select it and click OK.

Comparing strings in Java

My nearest project will be for Android platform and this week I was exploring the platform and Java since last five years I've been developing using Microsoft .Net.

Yesterday I needed to check if response status from web service is eqaul to "ok". I was influented by .Net experience and did it just like this:
if (responseStatus == "ok")
I didn't expect this will not work. After some digging in Java documentation I found out that by using "==" operator I compared addresses of strings instead of contents.

The right ways to compare strings in Java are:
if (string1.equals(string2))
if (string1.equalsIgnoreCase(string2))

Friday, May 15, 2009

BlackBerry and Android platforms

Next project I'll be working on will be for cell phones. I'm not sure about the platform (we're thinking of BlackBerry or Android).
So last four days I spent checking out their SDKs. I'd like to share my impression of them.

Let me break it into several steps I went through.

Web site

Android site looks positive and leaves a feeling of openness.
BlackBerry web site looks more like a part of business and does not provide positive emotions. On the same time I felt like these guys from RIM didn't finish their job. I don't complain about the need to register (that's not a big deal), but forms for registration and downloading are like unfinished paintings. Looks fine, but doesn't feel good.
And a few words about the content. I think that content is pretty good on both sites. Probably it is better structured on Android site. Special thanks to BlackBerry for videos: it's faster than reading and it inspires to eat it all (when I read sometimes I skip parts to come back in minute which is not productive, but it's a habit I'm fighting with).

Installation

Android is a winner here. No issues at all, just followed instructions on web site.
Installing BlackBerry took much more time. And I must confess that I couldn't install Eclipse plug-in. After fighting for an hour (half of which took the download itself) I quit. That was after I installed and tried BlackBerry JDE otherwise I would proceed fighting with installer. Installing BlackBerry JDE did not bring much problem thanks to a tip with PATH variable (http://moazzam-khan.com/blog/?p=52).

Playing with development

Two main points here are: I liked Eclipse more then BlackBerry JDE and there is Eclipse supports drag&drop designer to create forms for Android.
Second one is a big plus because it allows to not digging into xml used to present forms for Android. Also looks like there is more standard GUI controls for Android.
In general working with Android brings a bit more pleasure.

Running/debugging and Emulator

When working with Android all you need to do is run your code from Eclipse and it will automatically started on emulator.
With BlackBerry the story is not so clear. After running application from BlackBerry JDE you need to manually go to Downloads menu item in emulator and run app there. After this JDE will hook up application and debug will be available.
Also I'd like to say that I had to create AVD (Android Virtual Device) for SDK version 1.5 because after installing SDK 1.5 I had emulator only for version 1.1. It was pretty simple following instructions from Android developers site.

Documentation

Both SDKs have good documentation. Android has clearer documentation and because it is on developers site it leaves a better feeling.


So my opinion is that developing for Android should bring more positive emotions to the life.

Tuesday, April 7, 2009

Multiple Models in One Form

At "The Pragmatic Bookshelf" there is an extract from "Advanced Rails Recipes" by Mike Clark that explains how to properly handle dynamic creation/removal of the dependent models on one form using ajax.
Here is the link Recipe 13.

Monday, March 23, 2009

Handling move from Rails 2.2.2 to 2.3.2 version

As I preffer to work on virtual machines (by the way my personal choice is VMware) I used one of them while getting in touch with Rails. I had version 2.2.2 installed there.
Today I created a new VM for working with Rails and found out that 2.3.2 version of Rails appeared there as a result of installation. New version of Rails arrived :)
Unfortunally I was not able to run any of my demos :(

To fix this issue I started with change in "config/environment.rb" by updating
RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
to
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
Then I had to run "rake rails:update".

Thats it. These two steps brought demos to life :)

Monday, March 16, 2009

Borland C++ 3.1

Today I needed to check some code in C++ and decided to use old good Borland C++ 3.11 just because it's fast to install it.
Unfortunatly I found out that my copy of it died together with my external drive :((
I must confess that it was not such an easy thing to find working download link on the web. But I found one at http://www.eni4ever.com/downloads.php?cat_id=1. This page also contains links to some old IDEs for other languages.

Friday, March 6, 2009

Blogger and Picasa are connected

Just discovered connection between Blogger and Picasa. I don't use Picasa to hold my photos. So when I navigated to Picasa on web from my Gmail account I was surprised to find out that I have four images in there.
After eximining what are these images I recognized images from my posts in Blogger. I didn't know about this kind of integration between Blogger and Picasa. Pretty interesting fact.

Tuesday, February 24, 2009

"services.exe" virus

Today when going to the web site of Nissan dealer present in my city I've got a virus. What it does is sending e-mails from my machine. Pretty unexpected situation.
Unfortunaly my antivirus did not stop it, but I found solution in a couple of minutes:
  • With the help of Task Manager I found additional services.exe running on the machine. The file was located at "C:\Windows\services.exe".
  • Since Windows thinks that this virus is a system component it does not allow to stop it. I used CopyLock application to remove it at the next system start.
  • Finally I removed this services.exe from the system startup list.
My system is healthy again!

Thursday, February 12, 2009

MVC vs MVP

Recently during my recearch on the different between MVC and MVP patterns I found two great articles.
Hear are two quotes from them.

1. Everything You Wanted To Know About MVC and MVP But Were Afraid To Ask

The two patterns are similar in that they both are concerned with separating concerns and they both contain Models and Views. Many consider the MVP pattern to simply be a variant of the MVC pattern. The key difference is suggested by the problem that the MVP pattern sought to solve with the MVP pattern. Who handles the user input?
With MVC, it’s always the controller’s responsibility to handle mouse and keyboard events. With MVP, GUI components themselves initially handle the user’s input, but delegate to the interpretation of that input to the presenter.

2. MVC or MVP Pattern – Whats the difference?

Here are the key differences between the patterns:

* MVP Pattern
o View is more loosely coupled to the model. The presenter is responsible for binding the model to the view.
o Easier to unit test because interaction with the view is through an interface
o Usually view to presenter map one to one. Complex views may have multi presenters.
*MVC Pattern
o Controller are based on behaviors and can be shared across views
o Can be responsible for determining which view to display (Front Controller Pattern)

Tuesday, February 3, 2009

Getting Ruby on Rails 2.2.2 working on Windows XP

When installing Rails 2.2.2 I ancountered a problem with sqlite3. Although sqlite3 is a default database used by Rails starting from version 2.2.2 on Windows XP is not such a trivial thing to make it work.

I started by trying to install sqlite3 using gem like this:
gem install sqlite3-ruby
But I got an error:
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.

C:/ruby/bin/ruby.exe extconf.rb install sqlite3-ruby
checking for fdatasync() in rt.lib... no
checking for sqlite3.h... no

nmake

Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

NMAKE : fatal error U1073: don't know how to make 'ruby.h'
Stop.
The solution is quite strange from my point of view:
  1. Download sqlite and sqlitedll from sqlite downloads (by now they are "sqlite-3_6_10.zip" and "sqlitedll-3_6_10.zip").

  2. Unzip both archives to Ruby bin folder ("C:\ruby\bin" on my machine). There should be three files: sqlite3.exe, sqlite3.dll and sqlite3.def.

  3. Install sqlite-ruby using such a command:
    gem install sqlite3-ruby --version 1.2.3
The strange thing is that if you do not use the version parameter installation will be unsuccessfull.

Thursday, January 29, 2009

The most unexpected explenation of delegates I've ever read

Once upon a time, in a strange land south of here, there was a worker named Peter. He was a diligent worker who would readily accept requests from his boss. However, his boss was a mean, untrusting man who insisted on steady progress reports. Since Peter did not want his boss standing in his office looking over his shoulder, Peter promised to notify his boss whenever his work progressed.


To read full story follow the link .NET Delegates: A C# Bedtime Story.

Wednesday, January 28, 2009

Mistical trojan mmmsfusf.dll

Two days ago for some reason my computer stopped working as expected. Every time I was open results of Google search a page to arclane.com opened. I scaned computer with antivirus and took a look in internet. But it didn't help much. Unfortunally I didn't have much time and decided to come back to the problem at the end of this week.

And guess what happened today? A compete nightmare every time I used my internet browser (which is IE 5) it took forever to open a page. Just like in old times of dial-up.
I couldn't live with such a problem even a day. After some inverstigation I found a dll called mmmgfwgf.dll in my system32 directory. Creation date + strange name + search in google.com = looks like it is my problem. And again I found just a little information. Actually I found just one link: http://www.threatexpert.com/report.aspx?md5=4d013b3b1e327cc9582acc74f65ac150. It explains what this, but there were nothing about repairing the system.

My first try to remove this trojan finished with the crash of system. Fortunally I created an image before starting experimenting.
Second try was much better:
  • First of all I used CopyLock to remove mmmsfusf.dll from system32.
  • Then I changed value of "AppInit_DLLs" registery value that is located in "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows". I simply removed path to mmmsfusf.dll from it.
  • And finally I removed "HKEY_CURRENT_USER\Software\Microsoft\WinPathCRC" key.
And I can work again!

Friday, January 16, 2009

Couple of words about Adobe Reader odd behavior

I guess almost everybody use Adobe Reader to read pdf documents. I'm the one of this army of users.

Recently I've detected one strange behaviour of this product:
  • Sometimes I close my laptop while using Adobe Reader in maximized window. This results in going to sleep mode for the a display (laptop itself operates as usual).
  • When I open laptop, for some reason Adobe Reader doesn't use maximized window although the its window covers all client space on the screen. This is pretty strange, because all other applications does not have such a problem.

I'm using Dell Inspiron 6400 and Adobe Reader 8.

Saturday, January 10, 2009

Using VMWare on computer with wide screen

I'm using VMWare for development for years now. I started using it when I had to work simalteniously on several projects that required different versions of same development tools.

I liked it very much so later on I decided to use VMWare at my home laptop as well. But with the great benefit one issue arised. I used to work in my virtual machines using full screen mode. The thing is that at my work I had a PC with regular 4:3 display (at least it was regular size four years ago), but my laptop has a widescreen. For some reason resolutions for widescreens are not available in virtual machine (in my case it should be 1280x800).

After some surfing in the Web and several trials I finally found a solution that works. Today I set up new VM from scratch and ancountered same issue. So I decided to post this solution on the Web. I hope this will help you to save some time solving the same issue.

Here is the solution:

  1. Start your virtual machine.
  2. Run "Registry Editor" (Start > Run > regedit.exe) in it.
  3. Select the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vmx_svga\Device0.
  4. Add a new string-value key for the desired resolution (RightClick > New > String Value) using the form of Resolution.x for the value name. For example: Name = Resolution.0; Value = 1280x800.
  5. Exit "Registry Editor".
  6. Shut down your VM.
  7. Add max width and height to "vmx" file of your VM as follows: svga.maxWidth = "1280" and svga.maxHeight = "800". Just open this file using Notepad and add strings at the end like this:
  8. Uncheck autofit for the guest in VMWare (View > Autofit Guest).
  9. Start your VM and set new resolution in "Display Properties".