473,890 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deployment project - conditional custom action

I have a deployment project that I'm setting up. I need to perform a
different custom action based on whether this is a first time install or an
update. Does anyone have any idea if it's possible to set the Condition
property of a custom action to determine if the currently running install is
upgrading a previous installation and if so how? I'm also open to other
methods of acheiving this functionality.
Apr 28 '07
13 9731
Follow these steps to reproduce:

1: create an install with 2 custom actions
2: install the application - the custom action associated with Not Installed
is run
3: increment the version number in the installer (in my case, from 2.8 to
2.81)
3a: when asked to update the guid, say yes
4: rebuild the install
5: run the install on the same machine the app was installed to in step 2
6 - the custom action associated with Not Installed is run - this is the
problem - the one for Installed should run instead

"Linda Liu [MSFT]" <v-****@online.mic rosoft.comwrote in message
news:ch******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Hi Matt,

Thank you for your feedback.

Based on my understanding, you have 2 custom actions in the MSI package.
When you launch the MSI package, you'd like one custom action to be
executed if the product is not installed, and the other custom action to
be
executed if the product has been installed.

I performed a test on this but didn't reproduce the problem. I create 2
custom actions and specify 'Not Installed' as the condition of the first
custom action and 'Installed' as the condition of the second one. Build
the
project and launch the MSI package.

When the MSI package is installed for the first time, the first custom
action is executed. When the MSI package is installed for the second time,
the second custom action is executed.
>I suspect what is actually happening is the setup determines there is a
previous version, uninstalls it, then procedes with installing as if for
the
first time.

No, it shouldn't be the case. When the an MSI package is installed for a
second time, the previous installation won't be uninstalled, and the MSI
package will just replace the previous installed files.

In addition, When the custom action is met, the real installation, in this
case replacing the previous installed files, has not started and the value
of the 'Installed' property is true if the previous installation exists.

Sincerely,
Linda Liu
Microsoft Online Community Support

May 22 '07 #11
Hi Matt,

Thank you for your prompt response.

I performed a test based on your steps and did see that the Installed
property returns false when the upgrade MSI package is installed.

In my previous test, I used the same MSI package, so the Installed property
returned true when the same MSI package was installed for the second time.

In your scenario, you should use the PREVIOUSVERSION SINSTALLED property,
which is a public property generated by VS.

For the custom action you want to execute when you install the MSI package
for the first time, use PREVIOUSVERSION SINSTALLED as the condition. For
the custom action you'd like to execute when upgrading, use Not
PREVIOUSVERSION SINSTALLED as the condition.

Please try my suggestion and let me know the result.

Sincerely,
Linda Liu
Microsoft Online Community Support

May 22 '07 #12
Linda,

Thanks for getting back to me on this. Using the PREVIOUSVERSION INSTALLED
condition seems to handle what I need beautifully. I still have some
internal testing to do, but I'm not expecting any of those tests to fail.
Thank you!!!

As long as we're in this thread, are the available properties documented
someplace? I'd be curious to see what else is available.

"Linda Liu [MSFT]" <v-****@online.mic rosoft.comwrote in message
news:zo******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Hi Matt,

Thank you for your prompt response.

I performed a test based on your steps and did see that the Installed
property returns false when the upgrade MSI package is installed.

In my previous test, I used the same MSI package, so the Installed
property
returned true when the same MSI package was installed for the second time.

In your scenario, you should use the PREVIOUSVERSION SINSTALLED property,
which is a public property generated by VS.

For the custom action you want to execute when you install the MSI package
for the first time, use PREVIOUSVERSION SINSTALLED as the condition. For
the custom action you'd like to execute when upgrading, use Not
PREVIOUSVERSION SINSTALLED as the condition.

Please try my suggestion and let me know the result.

Sincerely,
Linda Liu
Microsoft Online Community Support

May 22 '07 #13
Hi Matt,

The PREVIOUSVERSION INSTALLED is not a standard MSI property. It's generated
by Visual Studio.

If you open the MSI package using Orca, and open the Upgrade table, you
should see PREVIOUSVERSION INSTALLED in the ActionProperty column.

For more information on MSI property, you may refer to the following MSDN
document:

'Property Reference'
http://msdn2.microsoft.com/en-us/library/aa370905.aspx

Hope this helps.
Sincerely,
Linda Liu
Microsoft Online Community Support

May 23 '07 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4936
by: Arun Bhalla | last post by:
I'm working with VS.NET 2003 and .NET 1.1 (not SP1) on Windows XP SP1. My application is using the Windows Installer Bootstrap. (I may have also installed a module which detects requirements (.NET 1.1 -> MsiNetAssembly Support.) I have a few issues and questions regarding the MSI and its properties. * This may be my biggest annoyance at the moment. When the installer creates the target directory, it's setting them as read-only. When the...
3
293
by: Jim Owen | last post by:
Hi All, I'm putting together my first web deployment project using VS2003 and have a few questions someone might be able to help on. First, I need to modify the web.config file based on entries made during the installation from one of the TextBoxes dialogs. Is this possible? If so, can someone point me in the direction of some doc or samples for this? Second, is it possible to return errors from a custom action back to the installer...
7
2850
by: dhussong | last post by:
I have created a Setup and Deployment project in Visual Studio.NET 2003. After my installation has completed running I'd like to launch the EXE that I just installed. I've found how to launch the EXE in the Custom Actions area of the Setup and Deployment project. Unfortunately when the EXE is launched it causes the setup program to stay open until the EXE has been exited. Anyone have any ideas how to launch the EXE and get the setup...
3
5861
by: KennethLundin | last post by:
Hi, i'm developing a solution in VS9/CSharp. Now I'm constructing a deployment project for my appliation (thick, database driven, winforms, standard, good old type of application). During installation I also install the PostgreSQL database and along with that I need to execute some Custom Actions. I've created a Custom Installer component in CSharp and calls it on Install/Rollback/ uninstall and everything works great (Custom Actions...
0
9976
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10801
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
8007
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7159
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6034
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4662
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4258
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.