|
|||
|
Hi,
I have an application that has an icon embedded in it. After installation, it uses this icon to create a shortcut on the desktop to open up a URL. When first run, everything is fine. However, when the PC reboots the image is broken. The link still works, but it doesn't display the .ico I used previously... I've only noticed this issue on Windows XP SP2 using SWFKit 2. Any ideas? Cheers, G. |
|
|||
|
Please send to support@swfkit.com, thank you.
|
|
|||
|
Hi,
I've used SWFKit to create a shortcut on the desktop using similar code to the following. findBrowser() is it's own script that will determine the location of the IEXPLORE .exe Code:
// find the location of Internet Explorer if it is not where expected
var InternetExplorer = findBrowser();
trace("InternetExplorer = " + InternetExplorer);
// find the location of the desktop folder
var desktop = Shell.getSpecialFolder("desktop");
trace("Desktop = " + desktop);
var shortcut = new Shortcut(desktop + "\\Test Link.lnk");
shortcut.targetPath = InternetExplorer;
shortcut.arguments = "http://www.whatever.com/";
var pathIEIcon = getAdditionalFile("desktop_icon2.ico");
trace("pathIE = " + pathIEIcon);
shortcut.iconLocation = pathIEIcon;
shortcut.description = "Test Link";
shortcut.save();
Cheers, G. |
|
|||
|
It seems that the icon is embedded in the .exe file, that is, not a disk file. The icon will be extracted to disk only if you run the .exe file. And when the .exe file is about to close, the icon file will be removed. Moreover, every time the icon will be extracted to a different directory. Therefore, the shortcut cannot find the icon when you close the .exe file. When it cannot find the icon, it displays a "broken" icon.
To resolve this problem, you would have to copy the icon to a stable folder, e.g. the application folder: Code:
var myIcon = getAdditionalFile("desktop_icon2.ico");
var fIcon = new File(myIcon);
var pathIEIcon = getAppDir() + "desktop_icon2.ico";
fIcon.copy(pathIEIcon);
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|