Thursday, August 28, 2008

iPhone has the big head but apple misses a point....

The UK banned a TV ad where Apple claims to "completely surf the web",
though it doesn't support Flash or Java.


http://www.crn.com/retail/210201022

Wednesday, August 20, 2008

OGG VORBIS and MOD tracker in Action Script 3

I just found out about this project and i love what have been done
in Flash

http://blog.joa-ebert.com/2008/07/24/as3-vorbis-encoder/

http://blog.andre-michelle.com/

Tuesday, August 19, 2008

Stop making scrollbars in SWF when displaying Text

Quoting Hoss Gifford text from his SWF sample

http://hossgifford.com/resizer/

This is a plea to you, the Flash developer community,
to stop making your own fucking scrollbars. They are fiddly,
non-standard and unintuitive to the average web user.

The thing is, all browsers already have scrollbars. And they
work really well. And everyone knows how to use them. But the
biggest criticism that Flash sites get again and again is their
fixed ‘letterbox’ format with text scrolling within an area of
that letterbox using some proprietary means of interactivity.

This doesn’t have to be the case. This file is a demonstration
of a technique that resizes the flash movie within the html page
to fit the content within the movie. It’s free to use and abuse,
whether you copy and paste it verbatim into your work, or if you
hack and slash it into something that suits the specifics of your
project.

Props to Geoff Stearns for his wonderful swfObject which this latest
version uses to greatly simplify things. Please check
"http://blog.deconcept.com/" for the latest version of swfObject as I
offer no guarantee that the version here is the most recent.

"Hoss Gifford,"
Glasgow,
14/11/2005

http://www.hossgifford.com/downloads.htm

Saturday, August 16, 2008

Things i hate about Vista

This blog entry will focus on all the things that i hate about vista.

1 When copying and pasting folder with large amount of files EG 100 000 from one USB drive to an other a pop up dialog appears saying that there is not enough memory to perform the operation after some times.

2 Explorer.exe process still crashing no improvement since Windows XP

3 Thumbnail view of images and video in explorer are not working so use Adobe Bridge :)

4 Dual screen mode is just wrong and it is not possible to consistently run vista on a laptop with a broken screen for instance using only the external connector. If you want to connect your laptop running vista to an LCD TV through the VGA external connector of your laptop and then later on if you unplug the VGA cable because you want either to use the TV with an other laptop or simply put the laptop to sleep then next time you turn the laptop on after plugging the VGA connector vista will forget that you want your TV as the primary screen. The log in window will show up all the time on the laptop screen. It should be expected to use the last settings which is also the most used settings. It will reset to default settings which is just wrong. On the other hand all windows from the operating OS will open on the wrong screen the secondary screen. Same for control panel settings, if you open control panel on one screen (external screen) and then open the display settings the dialog will open on the wrong screen the "primary" laptop screen.

5 .... coming soon

Monday, July 21, 2008

Installing IIS on Windows XP Pro / Reminder

Since i always forgot

Installing IIS on Windows XP Pro

If you are running Windows XP Professional on your computer you can install Microsoft's web server, Internet Information Server 5.1 (IIS) for free from the Windows XP Pro installation CD and configure it to run on your system by following the instructions below: -

1. Place the Windows XP Professional CD-Rom into your CD-Rom Drive.

2. Open 'Add/Remove Windows Components' found in 'Add/Remove Programs' in the 'Control Panel'.

3. Place a tick in the check box for 'Internet Information Services (IIS)' leaving all the default installation settings intact.

4. Once IIS is installed on your machine you can view your home page in a web browser by typing 'http://localhost' (you can substitute 'localhost' for the name of your computer) into the address bar of your web browser. If you have not placed your web site into the default directory you should now be looking at the IIS documentation.

5. If you are not sure of the name of your computer right-click on the 'My Computer' icon on your desktop, select 'Properties' from the shortcut menu, and click on the 'Computer Name' tab.

6. Your default web directory to place your web site in is 'C:\Inetpub\wwwroot', but if you don't want to over write the IIS documentation found in this directory you can set up your own virtual directory through the 'Internet Information Services' console.

7. The 'Internet Information Services' console can be found in the 'Administration Tools' in the 'Control Panel' under 'Performance and Maintenance', if you do not have the control panel in Classic View.

8. Double-click on the 'Internet Information Services' icon.

8. Once the 'Internet Information Services' console is open you will see any IIS web services you have running on your machine including the SMTP server and FTP server, if you chose to install them with IIS.

9. To add a new virtual directory right click on 'Default Web Site' and select 'New', followed by 'Virtual Directory', from the drop down list.

7. Next you will see the 'Virtual Directory Creation Wizard' from the first screen click the 'next' button.

9. You will then be asked to type in an 'Alias' by which you will access the virtual directory from your web browser (this is the name you will type into your web browser after 'localhost' to view any web pages you place in the directory).

10. Next you will see a 'Browse...' button, click on this to select the directory your web site pages are in on your computer, after which click on the 'next' button to continue.

11. On the final part of the wizard you will see a series of boxes, if you are not worried about security then select them all, if you are and want to run ASP scripts then check the first two, followed by the 'next' button.

12. Once the virtual directory is created you can view the web pages in the folder by typing 'http://localhost/aliasName' (where 'aliasName' is, place the alias you called the virtual directory) into the address bar of your web browser (you can substitute 'localhost' for the name of your computer if you wish).

Wednesday, July 16, 2008

How to detect the selected language on Mac OS 10 Tiger/Leopard

I noticed many post on Apple Dev web site of people trying to know what is the current language selected on Mac OS 10 when doing a drag and drop of japanese language before english.

The following code tested on Tiger will work like a charm.

static Boolean s_curLangInited = FALSE;
static Boolean s_bJapanese = FALSE;

if (!s_curLangInited)
{
CFComparisonResult result;
CFStringEncoding encoding = kCFStringEncodingMacRoman; // = 0;
CFAllocatorRef alloc_default = kCFAllocatorDefault; // = NULL;

// a couple of c string literals.
const char cstr_ja[] = "ja_JP";

// convert from c string to CFString
CFStringRef cf_jaString = CFStringCreateWithCString(alloc_default,cstr_ja,encoding);
//CString curLangStr = AfxGetApp()->GetProfileString(_T("Settings"), _T("Language"), _T("nil"));
CFLocaleRef loc = ::CFLocaleCopyCurrent();
CFStringRef cf_lang = (CFStringRef)::CFLocaleGetValue (loc, kCFLocaleLanguageCode);

CFMutableArrayRef available_locales;
CFArrayRef intersected_locales;
char user_locale[50];
struct direct *file;
DIR *dir;
CFArrayRef prefered_languages;

CFLocaleRef user_locale_ref = CFLocaleCopyCurrent();
CFStringRef user_locale_string_ref = CFLocaleGetIdentifier( user_locale_ref );

/* the prefered language in System Preferences.app, because it can differ from CFLocaleCopyCurrent().
However this prefered language is stored using the general language denotation
that may not include the country code (en,fr,en-GB,...) which is not accepted
by setlocale (setlocale would expect en_US,fr_FR,en_GB,...).

So we retrieve possible locales from /usr/share/locale and intersect them
with the prefered languages using CFBundleCopyLocalizationsForPreferences.
*/
dir = opendir("/usr/share/locale");
available_locales = CFArrayCreateMutable(kCFAllocatorDefault, 0, NULL);
while ((file = readdir(dir)))
{
/* This filters the 'right' locales (xx_xx.UTF-8) */
if (strstr(file->d_name, ".UTF-8"))
CFArrayAppendValue(available_locales, (void*)CFStringCreateWithCString(kCFAllocatorDefault,
file->d_name, kCFStringEncodingUTF8));
}
closedir(dir);

CFPreferencesAppSynchronize(kCFPreferencesAnyApplication);
prefered_languages = (CFArrayRef)CFPreferencesCopyValue( CFSTR("AppleLanguages"), kCFPreferencesAnyApplication,
kCFPreferencesCurrentUser, kCFPreferencesAnyHost);

if (prefered_languages)
{
CFArrayRef intersected_locales = (CFArrayRef)CFBundleCopyLocalizationsForPreferences(available_locales, prefered_languages);
CFStringRef user_language = NULL;

if(CFArrayGetCount(intersected_locales))
user_language = (CFStringRef)CFArrayGetValueAtIndex(intersected_locales, 0);
if(user_language)
{
CFStringGetCString( user_language, user_locale, sizeof(user_locale), kCFStringEncodingUTF8 );

result = CFStringCompareWithOptions(user_language, cf_jaString, CFRangeMake( 0 ,CFStringGetLength(cf_jaString)), kCFCompareCaseInsensitive);
if (result == kCFCompareEqualTo) {

s_bJapanese = true;
}
else
{
s_bJapanese = false;
}

Tuesday, July 15, 2008

why didn't Apple let AT&T sell/activate the new iPhone over launch weekend?

good question !

http://www.flickr.com/photos/lasean/2668369038/

Monday, July 14, 2008

Papervision 3d

An interesting 3d engine alternative

http://www.papervision3d.org/

Tuesday, July 01, 2008

Modal Dialog using Carbon

Not a long time ago i was force to find a way to display an Alert Dialog on MAC OS X
and here is a basic sequence to display a modal dialog on the mac similar to Win32 MessageBox

{
DialogRef alert;
DialogItemIndex outHit;
CFStringRef errMsg;
CFStringRef errorExplanation;
UInt32 textLength;

alertStringExplanation = SomeUTF String
alertStringTitle = SomeUTF String

l1 = alertStringExplanation.length();
l2 = alertStringTitle.length();
textLength = l2;
errMsg = ::CFStringCreateWithBytes(NULL, (UInt8 *) alertStringTitle.get(), textLength, CFStringGetSystemEncoding(), false);
textLength = l1;

errorExplanation = ::CFStringCreateWithBytes(NULL, (UInt8 *) alertStringExplanation.get(), textLength, CFStringGetSystemEncoding(), false);
UInt32 numUnicodeChars = ::CFStringGetMaximumSizeForEncoding(textLength, kCFStringEncodingUnicode);

CreateStandardAlert(kAlertCautionAlert, errMsg, errorExplanation, NULL, &alert);
RunStandardAlert(alert, NULL, &outHit);

}

Indexing SWF file

http://seekingalpha.com/article/83397-adobe-ups-relevance-with-searchable-flash?source=yahoo

For most people on the Web, if Google or Yahoo cannot find something, it doesn’t exist. That has been one of the biggest drawbacks to creating a Website or application that displays itself as a Flash (SWF) file. Search engines could see the file, but they could not see what was in it. Until now.

Adobe has come up with a way for the search engines to read SWF files and index all of the information they contain. That means any text or links in a Flash application can now be indexed. This is a huge step forward for Adobe and anyone who develops in Flash/Flex. Michele Turner, Adobe’s VP of marketing for its platform business, explains:

We are releasing technology to Google and Yahoo that enables them to crawl and index SWF files. They are now searchable. This will open up millions of Flash files to search.

Adobe has created a special Flash player for the search engines that acts like a virtual user going through each application. It actually goes through the runtime of each Flash application and translates it into something the search engines can understand. So all of those fancy interactive Flash Websites and other rich Internet applications that have been invisible to search engines, can now be seen by them.

Turner acknowledges that this invisibility so far “has been a big problem for those developing rich applications.” After all, it doesn’t matter how pretty your Website is if nobody can find it. Flash applications and Websites (many ironically created by ad agencies) have not been able to take advantage of any of the search-engine juice that so many online ad campaigns depend upon. This should be seen as part of Adobe’s larger efforts to remove any remaining restrictions associated with Flash (in April, for instance, it opened up the Flash runtime as part of its the Open Screen Project).

Google is already rolling out the SWF-indexing technology, while Yahoo still “has some work to do,” says Turner. Even so, this won’t solve all the problems with Flash content showing up on search engines.

Google SWF

http://googlewebmastercentral.blogspot.com/2008/06/improved-flash-indexing.html

ADOBE SWF searchability

http://www.adobe.com/devnet/flashplayer/articles/swf_searchability.html

Thursday, June 26, 2008

Flash web sites sample that i like

Max 2007 award winning web site in movie'a category was just incredible using the best advantage of Flash 9 and Adobe Creative Suite. Can't wait to see what will be the result of upcoming web site taking advantage of the new Flash 10 as well as CS3 suite.

http://www.ilm.com/theshow/

Foxit PDF Preview Handler for Windows Vista, Office 2007 and Windows XP.

You’ve likely reached this page as a result of a search or a referral. This page contains the most current links to download the Foxit PDF Preview Handler for Windows Vista, Office 2007 and Windows XP.

The Foxit PDF Preview Handler is a piece of software written by Tim Heuer with sponsorship from Foxit Software (providing the license so that we all can enjoy). Special thanks to Ryan Gregg for help with the Windows XP version. These preview handlers are a part of Microsoft Windows Vista in the operating system as well as in Outlook 2007.

Tim Heuer wrote:

For example, in Outlook 2007, if you receive an attachment that is a PDF you can click it and get a preview of that document right within Outlook without having to open the document in another program. It is an extremely helpful feature of Outlook that I love and why I wrote this handler for PDFs. Microsoft did not provide a default one for PDFs as a part of Outlook or Vista. If you install Adobe Acrobat 8.1+ you will get one as well. However, I am not a fan of Acrobat Reader as I think it is a slow application for what I use PDFs for – reading only. For this I prefer Foxit Reader as it is super light-weight and fast.

http://timheuer.com/blog/archive/2008/05/09/foxit-pdf-preview-handler.aspx

About straight and premultiplied channels


Practical advice for developers
(from DVD-HQ.info)




This section is aimed mainly at software developers, but regular users should read it too, because it shows how simple it is to deal with these issues from a programming point of view.




It might sound a bit self-righteous to write an article telling Photoshop's or 3dsmax's programmers how to do their job but... well, someone has to, because it's pretty obvious they aren't going to get it right by themselves (both are up to version 9, and are still lacking basic alpha channel conversion abilities).




First, here are the formulas to convert between matted and non-matted alpha. They can deal with any matte colour and are easy to implement for any colour depth and in any language. The variables used in the formulas are:




Cm = Component (matted)

Cu = Component (unmatted)

Cb = Component (background / matte colour)

a = Alpha

amax = Maximum possible alpha value (ex., 1.0)




All values are assumed to vary between 0.0 and 1.0 (for 8-bit files this would be 0-255 and for 16-bit files it would be 0-65535; remember to divide by the scale if you use anything other than 0.0-1.0).




To convert from unmatted alpha to matted alpha:




Cm = ( Cu ∙ a ) + [ Cb ∙ ( amax - a ) ]




To convert from matted alpha to straight (unmatted) alpha:





If a = 0, then Cu = Cm

Else, Cu = [ Cm - Cb ∙ ( amax - a ) ] / a




The formulas should be applied once to each colour component (ex.: R, G and B) of each pixel.




Those formulas are enough to add support for alpha channel conversion (with any matte colour) to any application. The software can then either cache a "working format" version of the image (generally meaning a straight-alpha version) or it can perform the conversion whenever it needs to read a pixel's colour channel values. There is really no excuse for not including this basic ability in a professional-level application.




The second issue is how to determine the kind of alpha channel used by a file that the user has just imported. One solution is to simply ask the user, but that's a pretty poor solution; users have more important things to worry about. So let's look at how software can determine the type of alpha channel and, if it turns out to be a matted alpha channel, how it can determine the background colour.




First we look for a pixel that is 100% transparent (0% opaque). If one exists, store its RGB values. Look for another pixel that is 100% transparent. Compare its RGB values with the ones previously stored. Repeat until the end of the file. If all pixels with 0% opacity have the same RGB values, it's almost guaranteed that that colour is the one used for the matte (if indeed there is a matte). If the colour varies, there's a good chance that we're looking at a straight-alpha file, or that the file uses some sort of really weird encoding (like the background bitmap example given above).




Now, even if all 100% transparent pixels have exactly the same colour, the file might still use "straight" alpha, so it's time to take the "background" RGB values we found above, plug them into the matted / unmatted conversion formulas and see if they make sense.




No pixel can have less of the matte colour in its RGB values than its alpha value would allow. For example, a colour channel in a pixel that is only 10% opaque cannot deviate more than 10% from the same channel of the matte colour.




If this condition isn't met by every pixel in the file, then there is no matte. If it is met by every pixel in the file, there's a very good chance that there is a matte, using the background colour we determined earlier.




There are other ways to make these decisions, some of which are simpler, faster, and will also get it right most of the time (for example, the program might analyse only a few pixels, rather than every pixel in the image).




Software should perform these tests when a file is first imported, and use the results to pre-fill the source format (or "footage interpretation") settings. This means that, in 99% of cases, the user will only need to click "ok".




If the tests are inconclusive (ex., because there are no transparent pixels in the file), then the software should ask the user to make the choice.




In any case, the user should always be given the option to toggle the type of alpha channel (between straight and matted), to pick the matte colour (manually or from the image) or to have the software "guess" the alpha channel type and matte colour again. These options should be available at any moment; not just when the file is first imported. If the software uses working proxies, a change of source format settings would cause the file to be re-imported.



(end of quote from DVD-HQ.info © Rui del-Negro 2008)

Friday, June 20, 2008

AS3 Flash 3D Engine Aletrnativa Platforms Drops A Nuke - Isometric and FPS

Alternativa Platform,

http://blog.alternativaplatform.com/en/2008/04/18/alternativa3d-5-m1/

previously Alternativa Game, launched their Alternativa Platform milestone 1 and really one demo would have been enough but there are some great demos there that literally put them what appears a couple laps up on the 3d FPS style engine in Flash.

The engine is highly optimized and smooth, heavy on the processor, but using the ‘t’ key you can see some nice revealing triangle rendering. Also, playing with the field of view adds for some nice game effects. (try jumping on the fans in the half-life like room in the first demo)

iPhone and Flash

http://www.crunchgear.com/2008/06/17/adobe-already-has-iphone-version-of-flash-running-on-emulator/


Adobe already has a version of Flash for the iPhone running on emulation software, and would, fingers crossed, be able to bring that over to the phone itself if Apple allowed it. That’s what Adobe said yesterday at its Q2 conference call. Or:

We have a version that’s working on the emulation. This is still on the computer and you know, we have to continue to move it from a test environment onto the device and continue to make it work. So we are pleased with the internal progress that we’ve made to date.

But will Apple allow Flash for the iPhone? Steve Jobs has claimed in the past that the mobile version of Flash—presumably what Adobe would be porting over to the iPhone—isn’t powerful enough for use on the nimble and elegant iPhone. Integration with Safari?

This leaves Adobe, if it wants a piece of that sweet, sweet iPhone market, with a few options. It could simply release a stand-alone Flash application on the upcoming App Store, but that would be cumbersome to say the least. One of the big reason why Flash is so popular is because it “just works” in a browser. No having to download Hulu videos to your hard drive in order to view them, for example.

Adobe could also, somehow, convince Apple to let it release a plugin for Safari. That’d be the most seamless for consumers.

Adobe has always take advantage of QuicktTime API and now QTKit so there is really no reason why Flash won't be fast on the iPhone

XMP Metadata, XFL and Flash = Complete End To End Solution

XFL

Since its inception, the Flash authoring tool has stored documents in a binary source-file called .fla. Historically, interchanging source with the Flash authoring tool has been virtually impossible for third-party software because the specification for .fla has never been public. But things are changing in the next version of Flash. Flash CS4 will be able to export *and* import a new source format called XFL. An XFL file is a .zip file that contains the source material for a Flash document. Within the .zip file resides an XML file describing the structure of the document and a folder with the document's assets (graphics, sounds, etc). The exact details of the XFL format are not yet available, but Richard assures me that Adobe intends to document them publicly, allowing third-party tools to import and export XFL.

So in theory, you might one day edit the images of an XFL file directly in Photoshop without disturbing the timeline information also contained in that file. Or you might be able to import a page from a word processing document into a Flash presentation.

But perhaps even more exciting is the potential for the smaller, grass-roots community. Being XML-based, the new XFL format should be fairly easy to understand and generate. That means any small tool company, web agency, or even independent developer will be able to create a purpose-built authoring tool that can output XFL. Of course, the XFL file would then need to be opened in the Flash authoring tool for final .swf export. But a .jsfl script should be able to ease the workflow between an XFL-generating tool and the Flash-authoring .swf-compilation process.

The natural next step in the evolution of XFL authoring would be to take the Flash authoring tool out of the equation altogether. If Adobe were to offer a command-line XFL-to-SWF compiler along with XFL, nearly any decent programmer would be able to create a .swf-authoring tool, even in ActionScript. The Flash developer community itself would finally be able to create its own custom Flash-authoring tools. I wonder who would be the first to nostalgically make Flash 4 for AIR in ActionScript?

XFL might not have the instant appeal of inverse kinematics, but it could eventually prove to be the feature in Flash CS4 that has the greatest impact on the Flash industry. After all, its name has an "X' in it.

http://www.moock.org/blog/archives/000269.html

XMP

http://www.adobe.com/products/xmp/indepth.html

FLASH AS3 AND VIDEO for WebAnalytics

http://blog.ickydime.com/2008/05/flash-analytics-deep-linking-and-seo.html

You may be interested to read more about interactive video in Flash CS4 as well

http://younsi.blogspot.com/2008/12/interactive-video-in-flash-using-f4v.html

Thursday, June 05, 2008

how to disable intellisense

For those few folks who work with huge source code more than 500 000 line of code and have big project you might want to disable intellisense. Why because
If I try to debug flash while intellisense process is running in the background, it crashes Visual Studio 2005....which force me to wait for intellisense to be complete when i launch my project or anytime intellisense has decided to start processing things again...
Not sure what is the advantage of intellisense... but for those who want to disable it :

In VS 2005 it can be done by renaming or deleting the following file:
\VC\vcpackages\feacp.dll

Or

You can also control IntelliSense through macros, allowing you to enable/disable IntelliSense without restarting VS or renaming files. See this blog article for the macro details: http://blogs.msdn.com/vcblog/archive/2007/11/19/controlling-intellisense-through-macros.aspx

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 !