Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > About new Setup and Deployment Project
 

About new Setup and Deployment Project

I am new to Setup and Deployment Projects. I have few queries for the same.

1. I want to install an engine.exe file and a file associated with that exe in the users desktop. But then, i need to check if the previous version of engine.exe exists and if it does, i will only install the file .

The thing works perfect : when i install my setup ( with that engine.exe + file bundled ) and when there isnt the instance of engine.exe . But if there is previous version of engine.exe , the setup fails as the engine.exe says "previous version is already installed". My second option of copying the file to the desktop even though the first action doesnt commit , doesnt work .

Is there a way to do that? Please Suggest.
Nitin.Sharma  Monday, August 13, 2007 4:36 PM

That message "previous version is already installed" (or "another version of this product is already installed") is nothing to do with your exe. You don't get messages when older versions of files are relaced with newer versions - the version rules are used automatically. You're running the same MSI file again, probably expecting it to just replace the existing files, but Windows Installer doesn't work like that. This should help:

http://www.simple-talk.com/dotnet/visual-studio/updates-to-setup-projects/

PhilWilson  Monday, August 13, 2007 6:50 PM

I am sorry to say : Perhaps my write-up was not clear.

"Previous version is already installed" message is of the engine.exe and not my setup.exe. Here, all i want is , even though engine.exe aborts its installation with the pop-up, i would want my setup.exe to skip the "engine.exe" and rather install the next bundled application and make the installation successful.

Now what happens is : the installation of setup.exe quits once that engine.exe cant be installed with an error message :

"There is a problem with the Windows Installer Package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor."

I hope i got myself clear this time.

Nitin.Sharma  Monday, August 13, 2007 9:14 PM

That message implies that you have a custom action that's failing, and if that's the case then your code is failing for some reason.

So you're saying that "previous version is already installed" is a message from your program, not from Windows?

The way setup&deployment projects work is that setup.exe is a bootstrapper that then launches an MSI file. In the MSI file you can have custom actions, and if they fail this will be detected and the install will roll back. It is extremely unusual (I've never seen it) to write custom action code to check if you're going to replace an existing versioned file because Windows handles all that for you automatically. If the version on the system has a lower version than the incoming one, then the incoming new version will replace the old one on disk. There's no need for you to write code to deal with it.

PhilWilson  Tuesday, August 14, 2007 7:54 PM

Thanks for the message.

I guess, i wanted only that . If a custom action install fails, can i have at least, some other custom action done ( like copying a file in the desktop) andskipping the failed one? I really am in need for such provisions.

Thank You again.

Nitin.Sharma  Wednesday, August 15, 2007 4:21 AM
The custom action that's failing is your code, it's something you've done in your code that's causing it to crash, an exception. I don't know why you want to run another custom action if that first one fails - how do you know your next custom action isn't going to fail too? You shouldfix your custom action code that's causing the installation to fail. If your application crashed you'd fix it, right? Or would you be asking thatwhen your application crashes the system should fire up another of your apps so you cando something else? The installer architecture is designed to be transactional, so that a product is successfully installed or it rolls back and leaves the system as it was before. Installations are not supposed to go ahead ignoring all errors and leaving some kind of half-broken app on the system.

PhilWilson  Wednesday, August 15, 2007 11:33 PM

You can use google to search for other answers

Custom Search

More Threads

• .NET 3.5 Publish Wizard -> Reports (.rdlc) -> How to Install Culture on target machine
• Calling WebService from XBAP throws 'System.Net.WebPermission' exception
• Restricted User cannot write to directory
• Install setup from .cab file
• How to run the exe file without UI made by InstallShield?
• how to create an exe in the programs folder
• Error downloading FileGroup
• I have a bug with a deployment project, help :(
• Shortcut Navigation over Network not allowed
• ClickOnce Acceptance in Enterprise Environments