views:

45

answers:

4

I created my MSI installer for our C# application via VS 2008. I installed it. It created a shortcut for me on the desktop. I clicked that shortcut, the setup process running again and at the end our application was launched. It was not like this yesterday before I added some custom action to create database. I didn't recreate the shortcut in the installer. why it is like this?

+1  A: 

Is the shortcut pointing to your application or your setup? If it's pointed to your setup and you change it to your application, does the problem go away?

Beth
+2  A: 

MSI comes with an auto-repair feature that checks whether all components installed by MSI are still present when you launch your application using the shortcut.

In your case, probably one (or more) components have been removed so the installer is launched again to repair your installation.

To prevent auto-repair from running either

  • Make sure no file, registry setting or other installed component is removed

or

  • Don't set the key path for those components. That will prevent MSI from checking those specific components

From your other questions it seems that your MSI has been created by a Visual Studio Setup and Deployment Project. Unfortunately, there is no option to modify the key path from within Visual Studio. You have the following options:

  • Modify the MSI manually using Orca (This is not a good option because it is a manual step)
  • Write a script e.g. using VBScript to patch the MSI file
  • Move to a more advanced install system which gives you more control such as WiX or NSIS
0xA3
you are right. I deleted some temp setup files (batch files and sql files). I need to find a way to avoid this. thanks
5YrsLaterDBA
@5YrsLaterDBA: As your setup seems already quite complex you should definitely have a look at other ways than VS for creating your setup. Anyway, the VS setup projects will die in the future. If you are using VS 2010 you might also try InstallShield LE.
0xA3
Sadly VS Setup Projects (VDPROJ) have no ability to control key files ( all resources including registry keys are a single key file to a single component ) and no way to disable advertised shortcuts. You have to be a pretty good MSI Jedi Master to know how to hack your way around the problem. I suggest looking at InstallShield 2010LE or WiX. VDPROJ died many years ago to me.
Christopher Painter
+1  A: 

Sounds like the system thinks the installation has been corrupted and is automatically attempting a repair,.Anything in the event logs (look for source of MsiInstaller in the Application Event log).

Have you been building multiple copies?

Andrew D
+1  A: 

Open the MSI manually using Orca. Add the following record to the Property table (Property, Value) without the quotes:

Property = 'DISABLEADVTSHORTCUTS' Value = '1'

This can also be scripted and run as part of a post build event.

rhinofrim