Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > show a message box before installing the new version of msi
 

show a message box before installing the new version of msi

Hi,

I have set the remove previous versions to true and increasing the version each time msi is built. Now, when it is installed the older version is unstalled and newer version is installed.

But before the installation starts, is it possible to check if an older version of msi is already installed and show a message like below
Do you want to install the newer version?

If yes ,it should install the newer version
If no, it should exit the installation

Is this possible??

Thank you.
yaradoddi  Wednesday, August 19, 2009 11:25 AM
Set RemovePreviousVersionsto true
Please mark the post as answer if it is helpfull to you because it boosts the members to answer more and more.
_SuDhiR_  Wednesday, August 19, 2009 11:33 AM
I have set RemovePreviousVersions to true and increased the version number. It is working as expected.

But what I want is

Show a message before the installation starts, asking the user if he wants to install the new version(if there is already an older version installed on his machine. If yes is clicked, it should proceed, If no, it should exit the installation at this point). Right now, it is installing the newer version without showing any information.

I want to let the user know that a new version is being installed. Right now, it is automatic(not showing any information)

Thank you.
yaradoddi  Wednesday, August 19, 2009 11:48 AM

Hi yaradoddi,

As far as I know, we can only use the ways below to custom a Setup project:

1. Add a dialog which contains two radio buttons for users to select a condition value. This would have us be able to setup some of the files. This is the detail information:
http://msdn.microsoft.com/en-us/library/ecaca8zb(VS.80).aspx.

2. Add a custom action to show a message box to allow users to check something and decide if continue. This is a walk through:
http://msdn.microsoft.com/en-us/library/d9k65z2d(VS.80).aspx.

This is a sample about the custom Install class which would continue or stop uninstalling according to the user input:

[RunInstaller(true)]

public partial class DataBaseInstall : Installer

{

public override void Uninstall(IDictionary savedState)

{

if (MessageBox.Show("Do you want to uninstall the program.", "warning", MessageBoxButtons.OKCancel) == DialogResult.OK)

base.Uninstall(savedState);

else

return;

}

}

But via this method, we cannot decide whether the uninstall process is started by a uninstall request or a install request. Another issue is that when we stop the uninstalling process, the install process would still start in the next step.

I have two ideas to achieve a similar goal:

1. We can install/uninstall a program in the user interface of the application. For example, we can add a update menu item to the main menu of the application. When user clicks the menu, we can popup a message box to have the user check whether to update.

2. We can use other tools to produce setup package, such as WIX, or ClickOnce.

WIX: http://msdn.microsoft.com/en-us/library/aa302186.aspx.

ClickOnce: http://msdn.microsoft.com/en-us/library/t71a733d(VS.80).aspx.

Let me know it these ideas helps.

Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
Aland Li  Friday, August 21, 2009 4:45 AM

Hi,

We are changing the issue type to “General Discussion�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by opening the Options list at the top of the post window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

Aland Li


Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
Aland Li  Wednesday, August 26, 2009 2:38 AM

You can use google to search for other answers

Custom Search

More Threads

• File and Folder Permissions during Installation
• Click-once and vista
• Dotfuscator problem with ClickOnce - recompiles twice
• Install Acrobat PDF 7.0 using MSI
• Attaching an Icon to an application
• How to make a deployment file in .net???
• Setup Project: How to remove Repair/Remove option?
• I can't launch the installer because of "cannot be installed because the file cannot be found in cabinet file" error.
• ClickOnce Unresponsive on Browser Install Click
• Must uninstall previous version when publishing Office Add-Ins