Incorrect Shortcut

martialarts

Regular
Joined
Jun 20, 2003
Messages
59
Location
Chicago Area
I am using VB.NET 2002 Standard and am trying to add shortcuts to my program from the desktop and the start menu. I can add the shortcuts without a problem. But when I click them, they install the program and then run it. It is strange and I am not sure what stupid mistake I have made. Thanks for your time!
 
Are you saying that the program isn't installed at install time, only the shortcuts? And that they cause the program to be installed when they're clicked?

Maybe there's a setting on some files that is telling it to only install them when required.
 
It runs the full installer when I run the msi file. But when I click the shortcuts, about half the time it shows a box saying that it is installing and then it opens the program... however, it doesn't run the full installation. There are no prompts but it does install again. This is only the case for the shortcuts, if I make my own shortcut from the application folder, it works great.
---
I think I just narrowed down the problem. When my program is installed, it creates the file firsttime.sys, which is used as a flag. When the user accepts the license agreement, firsttime.sys is deleted. When firsttime.sys is missing, the shortcut reinstalls the program before it runs it, however the executable in the application folder runs perfectly. Is the shortcut a like to the entire compiled solutions as opposed to merely being a shortcut to the executable? Thanks for your time!
 
Last edited:
I've had precisely the same problem. The installer creates a shortcut for the desktop that points only to the folder which the program is in - NOT to the specefic executable. I've tried everything I know to get the shortcut pointed to the executable and nothing seems to work. If there is only one executable in the folder, it usually executes correctly, but if there is more than one, it attempts to do a reinstall. Making my own shortcut works fine, because I point it to the specific executable. Any ideas? Is this a bug in the installer?
 
Well, I decided to spend today solving the problem. I do have the answer to our problem! It took me about 6 hours to figure this out, but like many things, it can be conveyed in only a couple minutes. The type of shortcut that we created is called an advertised shortcut, which means that it checks the "health" of the solution before running the executable. If the program isn't healthy, it will try to reinstall itself. What we want is a non-advertised shortcut, which is just a regular shortcut like the ones you can create in Windows by right-clicing an executable and clicking Create Shortcut. The sources I found referred to two main ways to fix this and the way I was able to utilize requires building the release version of the solution and then editing the installer msi with a program called Orca. Orca takes apart the installation package and allows you to edit it. The following worked for me:

1. Orca is included in the Windows Install SDK, which is found in the Platform SDK at the following link:
Platform SDK
2. After downloading and intalling this, you have to go to C:\Program Files\Microsoft SDK\Bin and install Orca by running orca.msi.
3. After installing Orca, run it and open the msi of your solution.
4. Choose Shortcut from the list on the left and change the Target of your shortcuts to
Code:
[TARGETDIR]\application.exe
where application.exe is your executable. I have a desktop and a start menu shortcut and had to change this for both.

The following link was what I used to start discovering a solution in case you want more information:
MSDN
Note that there are three related Q&A's on this page.

This seems to have worked for me and makes sense. I hope it works for you also. Don't hesitate to post if you have any questions. Good luck!
 
No problem. My program only tried to reinstall on a rare occasion, so it will be a long time before I can confirm that this has fixed the problem for me. It sounds like you were having the reinstallation problem frequently, so if you ever have problems with this again, please let me know so I can make sure I completely eliminate the problem from my program. Thanks!
 
Guys can anyone Zip the Orca.msi urgently and post it or something, it will take forever to download the installer 2.0 85 MB
. I just faced the same problem, i dont know what happened everything was going smoothly unitl today.
 
OK problem solved,

I created another setup project from scratch although i have been using the old one for a long time now. Don't know what messed it up. The new setup works fine, Did you try that out ?
 
Back
Top