Thursday, April 10, 2008

Pros and cons of automatic update

Pros and cons of automatic update


Lately Microsoft has decided to push Silverlight on Vista SP1 and will certainly do the same things with Microsoft XP SP3. Nothing wrong about that. I have no objection with Automatic update at all since it is a great way to increase user experience but... only if the user has the choice... By combining all there fix in a Service pack they just find a way to update there platform.... When you install a software you can always see the software through the Add Remove Program for instance this is a good practice for stand alone runtime such as Visual Studio Runtime, .Net, Flash Player Active X Control, Air Runtime. But why Microsoft don't give this Option when user install the Service Pack.... Why not offering some component selection to the end user instead of installing a bunch of file with no report of what was really installed. Apple on Mac OSX offer this feature right(give the user a choice ). What i recommend is not to use automatic update or service Pack but rather check for available update and pick the one you really need or want !

Finally what i like with semi automatic update is not to seat in the tray icon and use my CPU but just be invoked by the application who need the service of the updater one time, ask the user.

Rebooting an XP machine and have to wait for udpates is not OPT-IN at ALL !

Tuesday, April 08, 2008

According to University of Utah researchers, using a larger monitor could save you 2.5 hours per day.

This study below suggests that your wall LCD would do wonders in the office. I hear people turn them on the side, for a portrait display, and they can look up and down the monitor at multiple documents.

According to University of Utah researchers, using a larger monitor could save you 2.5 hours per day.

Specifically, test subjects completed everyday tasks like editing documents and massaging spreadsheets 52% faster when using a 24-inch monitor than they did with an 18-incher.

http://www.fourhourworkweek.com/blog/2008/03/15/size-does-matter-bigger-monitors-save-25-hours-a-day/

How to add automatic updater to a null soft installer and the pros and cons of automatic updates

I really think that when it comes to windows installer the most convenient and easy to use installer suite available on the market is nullsoft installer.
To build an installer you only need to write a UTF-8 script using your favorites editor. When it comes to automatic update i really like a software written by a smart guy in Netherland. The updater can be purchase from http://www.catenalogic.com/

Once you get the updater you need to hook the updater into your installer.
To do so you need to provide a way to check for update from the start menu
using a shortcut towards the updater.exe. Your application should also execute the updater as well once in a while (periodic perdiod) or during each startup.

Here is what you need to add to your null soft script to provide a complete end to end update solution to you application.

First you need to compress the updater files and custom graphics such as top banner and left bitmap. Be carefull, the size of the graphics element are very important. One pixel off and you will see the default graphics instead.

!define CLIENT_VERSION "1.0"
!define CLIENT_NAME "MyHelloWorld Sample Application"
!define PRODUCT_NAME "${CLIENT_NAME}"
!define PRODUCT_VERSION "1.0.0.0"
!define SETUP_FILE "setup_1_0.exe"

!define APP_FILE1 "..\files\HelloWorld.exe"
!define UPDATER_FILE1 "..\files\updater.exe"
!define UPDATER_FILE2 "..\files\updaterbanner.bmp"
!define UPDATER_FILE3 "..\files\updaterleft.bmp"


Inside the Installer section of your script
you need to add script code to uncompress and copy the updater files
inside the target program file folder for your application. The one choosen
by the user or set by default under Program Files.

;script start

SetOverwrite ifnewer

CreateDirectory "$PROGRAMFILES\MyApp"

SetOutPath "$PROGRAMFILES\MyApp"

;HelloWorld.exe application file
File "${APP_FILE1}"

;UPDATER FILES TO EXTRACT
File "${UPDATER_FILE1}"
File "${UPDATER_FILE2}"
File "${UPDATER_FILE3}"

;you need to generate and update the settings.ini file
;used by the updater.exe so that the updater will know where to download
;the XML file on the update server. The updater will compare your
;application version set in the ini with the one available on the remote
;server. Because this call is self contain in the installer once you will
;uninstall and install a new version it will automatically update the up to
;date settings.ini

;Update Updater INI file with installation application path and product version
FileOpen $1 "$INSTDIR\settings.ini" w
;FileSeek $1 0 END $INI_SIZE
FileWrite $1 "[UPDATER]$\r$\n"
FileWrite $1 "runmode=full$\r$\n"
FileWrite $1 "logolarge=updaterleft.bmp$\r$\n"
FileWrite $1 "logosmall=updaterbanner.bmp$\r$\n"
FileWrite $1 "customnotification=false$\r$\n"
FileWrite $1 "[UPDATEINFO]$\r$\n"
FileWrite $1 "URL=http://www.yourwebserverforupdate.com/download/HelloWorld/full/update.xml$\r$\n"

;as you see the update.xml will provide a way for updater to get http path
;for update along with command (action) to execute in a chronological order.
;I will post a sample XML file in an other article.

FileWrite $1 "servertimeout=2000$\r$\n"
FileWrite $1 "[APPLICATION]$\r$\n"

StrCpy $KEY "name="
FileWrite $1 $KEY
StrCpy $VALUE "${PRODUCT_NAME}"
FileWrite $1 $VALUE
FileWrite $1 "$\r$\n"

StrCpy $KEY "version="
FileWrite $1 $KEY
StrCpy $VALUE ${CLIENT_VERSION}
FileWrite $1 $VALUE
FileWrite $1 "$\r$\n"

StrCpy $KEY "location="
FileWrite $1 $KEY
StrCpy $VALUE $INSTDIR\HelloWorld.exe
FileWrite $1 $VALUE
FileWrite $1 "$\r$\n"

FileWrite $1 "[PROXY]$\r$\n"
FileWrite $1 "type=autodetect$\r$\n"

FileClose $1

;last things you need to do is to create a shortcut.
;Te cool things with nullsoft when you create a shortcut is that
;it will use the last SetOutPath call as the working directory for your
;shortcut. Alternatively you can specify the path of the settings.ini

StrCpy $STARTMENU_FOLDER "MyHelloWorldApplication"

SetOutPath "$PROGRAMFILES\HelloWorld"
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Check for update.lnk" "$INSTDIR\updater.exe"

In your application code you will launch updater.exe from your application folder.
You can also read a registry key to get a custom path. This registry key will be set by the installer itself.



Finally what i like with semi automatic update is not to seat in the tray icon and use my CPU but just be invoked by the application who need the service of the updater one time, ask the user.



Hope you will find this Null Soft Updater Script for catenalogic useful !