Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Shortcut Icon picture from VB's setup program.

Status
Not open for further replies.

shope

Programmer
Nov 1, 2001
12
0
0
CA
Does anyone know how I could change the icon picture on a shortcut created using vb's installation program?

I want to use the icon in the compiled vb exe file but, I use VBScript to start the application (to get the lastest version of the file from the LAN) and I don't want all of the vb programs that we use to have the same (ugly) script icon.

Any suggestions?
Scott
shope@gov.mb.ca
 
This doesn't directly address the question of setting the icon for a script with the PDW... but you might be able to set the shortcut icon the first time the user runs a new version of your app.

See thread711-157797. I haven't tried this with shortcuts to scripts but theoretically, you should be able to check for the existence of the shortcut and either create it (if none) or modify it based on whether or not a new version of the app has been installed (again... this would be performed after setup.)

Compare [tt]App.Major[/tt] with the value returned by [tt]GetSetting(App.EXEName, "Version", "Major", "N/A")[/tt]. If the value returned is "N/A" then create a new shortcut. If the values simply don't match, then [tt]SaveSetting App.EXEName, "Version", "Major", App.Major[/tt] and use the link-modifying code in thread711-157797 to set the application path to your script and the icon index to an icon in your app.

Should work.... If not, have you considered integrating the functionality of the version-checking script into your application? You might be able to kill two birds with one stone.
VCA.gif
 
Thanks people for responding to the post, I appreciate it.

The first suggestion of changing the icon using the properties is not possible. I have to install applications on 100+ stations at various locations in the city and cannot do this myself.

The second suggestion is also not viable. Just because I know where the app's exe is doesn't mean I know where the shortcut is located.

I have however found a solution that will work in my environment. I modified the setup1.vbp program to use a "Scripting.Shell" object (scripting is installed on all our machines for sure) that takes care of the icon.

But I still do thank you for taking the time to answer my question.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top