Archive: TIP: CD/DVD Icon on XP...


TIP: CD/DVD Icon on XP...
Hello Everyone,

I know this isn't specifically NSIS related, but it IS installer related and drove me crazy. I have an autorun.inf file with the following contents (see below). When I burn the contents to a CD/DVD with the proper structure and autorun file, then place the disc in a drive, I don't get the desired or expected results.

My autorun.inf contains:

code:
[autorun]
open=myapps\setup.exe
icon=myicon.ico,1
label="MyStrangeSetup"

and my CD/DVD disc has the following structure:

myapps\Setup.exe
myapps\readme.txt
autorun.inf
myicon.ico

The autorun open portion works fine, but the icon only displays in Windows Explorer IF and only IF the Operating System is 95/98/ME/NT/2K but NOT XP.

In XP I do NOT get the icon associated. :-( It only shows the OS default icon.

Tried this on ~20 different machines, all the XP ones fail, all the others mentioned were tested and passed.
It is a Windows bug, have a cookie!

WAIT.. the answer is simple.

You CANNOT specify BOTH ICON and LABEL in the autorun.inf !

It produces inconsistent results, usually not showing the icon. Depending on the icon order, you may get other results on older Windows versions, as well.
The best way to do it? Label the disc properly in your burning app and just not use label= in autorun.inf. Removing the "label=" option solves the problem.

Oh, and keep the CD labeltext under 16 chars. There's another bug lurking there...

Hint:
If your burning software lets you set file burning precedence (such as Nero), set the autorun.inf to be low, and whatever program autoruns as well as the installer to
high. If the icon is its own .ico file, set that to low. Leave all other files at medium. This has helped me make discs that feel far more responsive on lower-end hardware (i.e. Win98 w/ 4x CD-ROM). Setting the priority to high also helps speed up the CRCCheck slightly.

Success creating better installers with NSIS.


Emin


you probably can remove the ",1" part, when pointing to an icon. i think it's only necessary when pointing to an executable (i.e. icon=myapps\setup.exe,1). i'm probably wrong, as the number should tell which icon is used, but try it anyways.


No that is right Yathosho, Iv done a few autorun.ini files. For help just pick up any disk and browse for the autorun file and study it. Games are better for this task.


i think label= couses problems on xp, also you probably dont need the icon index (or set it to 0 atleast)


Yes Anders, you are right, that was what the article was all about ;) Thanks for confirming...


sure, that 1 is the right icon index?
beware, that the first icon is indexed with 0 (zero) :)


Yes, a 1 - because for me the first one was the setup icon the second (icon id 1) a CD/DVD symbolic setupicon.

Thanks for looking so precise anyhow...