开发者

.NET Installer Project - Create shortcut keeps reinstalling everytime

I have a .NET project (VS2008 .NET 3.5) that builds an exe. I have an installer project as part of the same solution that creates an installer for that exe.

In the File System for the installer, I create a folder for my application under the User's Programs Menu. In that new folder, I dump the .exe and .exe.config. I also create a shortcut in that same folder AND a shortcut on the desktop. The shortcut was created by right clicking on the "Primary output from Application(Active)" and selecting "Create shortcut to Primary output from 开发者_JS百科Application(Active)".

Everything installs fine. If I click on the .exe it runs fine. When I click on either of the shortcuts though, it pops up this small "Installing" pop up window with a progress bar. I have no idea where it came from or what it is doing.

Any ideas?


The reason the product keeps re-installing as that the second shortcut (that keeps re-installing) is an "Advertised ShortCut" . If you touch anything in the application's target deployment directory then next time you run the application it will try to re-install to fix the issue.

See my post for a more detailed discussion:
http://ntsblog.homedev.com.au/index.php/2011/08/17/setup-app-config-during-msi-install-msi-re-installing/


If you look in the Windows Event Viewer (eventvwr.exe) and go to the "Application Log" you should see an event attributed to "Windows Installer". This will offer you what it is that is causing the repair activity. It will identify the component by its GUID so it won't seem helpful right away.

Open the installer in a tool like ORCA or InstEd which are MSI editors to search the components table for the GUID identified in the error log.

At this point you at least know "what". I'd say that "why" will be an answer with a lot of variables difficult to pin down without using this process to better understand the problem with which you are dealing.


It's a long shot... but maybe check short cut's "Start In" property. Hopefully it's set to be where the Primary Output is installed.

I've seen other deployment installations behave oddly when the Start-In property is wrong.


I think that I figured it out... and it leans towards me not understanding what the hell I was doing. Originally, I would right click on the "Primary output from {project} (Active) item and select "Create shortcut to..." and that would create the shortcut that would in turn fire off the installer.

What I did different this time is right clicking on the file pane under the "User's Programs Menu" and selecting "Create Shortcut to {project}". In the pop up window, navigate down to the "User's Programs Menu" and select the "Primary output from {project} (Active)" item and it will create a shortcut that works just fine when installed.

The only difference I can see once the app is installed, is that the Target of the one that works is pointing right at the project's exe. The one that doesn't work lists the name of the application as the Target.

Two different ways of creating a shortcut to the exact same item in the Installer project. There must be a fundamental difference that I'm not understanding. For now I know how to make it work.

Thank you all for you input!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜