473,699 Members | 2,566 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 #1
13 9708
How are you deploying it? ClickOnce? Or WindowsInstalle r?

What is the custom action that you need to perform?

Robin S.
----------------
"Matt F" <mf************ ****@nospam.nos pamwrote in message
news:%2******** *********@TK2MS FTNGP03.phx.gbl ...
>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 30 '07 #2
Hi Matt,

Based on my understanding, you'd like to add a condition based on whether
the MSI package is installed for the first time or not, on a custom action.
If I'm off base, please feel free to let me know.

The Installed property is initialized if the product is already installed
on the system. If you want to run a custom action only when the product is
first installed, you can use Not Installed as a condition.

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 30 '07 #3
I've released using a different method of determing what I need to know but
I will need to get this resolved for future releases.

This s a windows installer project.

In the "commit" custom action, I need to call my application with a
different command line parameter based on whether it's a new install or an
upgrade to a previous install. The function of the command line parameter
will determine whether to upgrade data from a previous installation or set
up the base sample data for the application. Yes, it's possible for me to
just check and see if the data is there, but there are firewall issues that
make that a less than optimal solution.

"RobinS" <Ro****@NoSpam. yah.nonewrote in message
news:r8******** *************** *******@comcast .com...
How are you deploying it? ClickOnce? Or WindowsInstalle r?

What is the custom action that you need to perform?

Robin S.
----------------
"Matt F" <mf************ ****@nospam.nos pamwrote in message
news:%2******** *********@TK2MS FTNGP03.phx.gbl ...
>>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 30 '07 #4
Linda,

I assume your talking about setting the condition property of the custom
action. The property appears to accept a text value --- is there an article
or some other information showing the syntax for how to use this property?

Also, I'm making a further assumption that the Installed property that your
speaking of is a property of the windows installer itself. If this is the
case and I'm testing the property in the commit cutom action, would it not
already be returning a value of true?
"Linda Liu [MSFT]" <v-****@online.mic rosoft.comwrote in message
news:WT******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Hi Matt,

Based on my understanding, you'd like to add a condition based on whether
the MSI package is installed for the first time or not, on a custom
action.
If I'm off base, please feel free to let me know.

The Installed property is initialized if the product is already installed
on the system. If you want to run a custom action only when the product is
first installed, you can use Not Installed as a condition.

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Apr 30 '07 #5
I'm glad you figured out a way to get it to work. I'm using ClickOnce
deployment, and I don't know that there's a way to tell.

Robin S.
---------------------------
"Matt F" <mf************ ****@nospam.nos pamwrote in message
news:e7******** ******@TK2MSFTN GP06.phx.gbl...
I've released using a different method of determing what I need to know
but I will need to get this resolved for future releases.

This s a windows installer project.

In the "commit" custom action, I need to call my application with a
different command line parameter based on whether it's a new install or
an upgrade to a previous install. The function of the command line
parameter will determine whether to upgrade data from a previous
installation or set up the base sample data for the application. Yes,
it's possible for me to just check and see if the data is there, but
there are firewall issues that make that a less than optimal solution.

"RobinS" <Ro****@NoSpam. yah.nonewrote in message
news:r8******** *************** *******@comcast .com...
>How are you deploying it? ClickOnce? Or WindowsInstalle r?

What is the custom action that you need to perform?

Robin S.
----------------
"Matt F" <mf************ ****@nospam.nos pamwrote in message
news:%2******* **********@TK2M SFTNGP03.phx.gb l...
>>>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.



May 1 '07 #6
Hi Matt,

Thank you for your prompt response.

The 'Installed' property is a standard Windows Installer property, which
returns the installation date time (in string) if the product has already
been installed on the machine.

There are only two major categories of custom actions. The category of a
custom action is indicated by a number in the type column of the
CustomAction table (You should be finding this table in Orca). The two
categories are Deferred and Immediate.

How you create the custom action in your MSI package? If you're using VS to
create it, it should be Deferred.

For Immediate custom action, we can specify the condition of the custom
action as Not Installed or Installed="" for the condition of new
installation, and Installed or Installed<>"" for upgrade installation.

My test shows that the Installed property always returns an empty string
when the deferred custom action is launched. In this case, you may add a
custom property and set the value of the Installed property to this
property in an Immediate custom action and then use this property as the
condition on your deferred custom action.

For more information on custom action, you may read the following article:

Custom Action Tutorial Part I ¨C Custom Action Types and Sequences
http://bonemanblog.blogspot.com/2005...-part-i-custom
..html

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

May 3 '07 #7
Hi Matt,

Sorry that I made a mistake in my previous reply.

I was trying to get the value of the Installed property in a VB script file
and create a commit custom action to run this VB script file in VS. The
content of the VB script file is like the following:
msgbox "Installed = " & Property("Insta lled")

When I install the MSI package for the first time, the message box pops up
showing an empty text. When I install the MSI package for the second time,
the message box pops up still showing an empty text.

I have read more about custom action later and realized that when a
deferred custom action is encountered, its condition is evaluated. If the
condition is met, the deferred custom action is written to the installation
script, and will be executed later; otherwise, it is not added to the
installation script.

My previous test shows that when the deferrd custom action is executed, the
value of the Installed property is an empty string. But my later test shows
when the deferred custom action is encountered, the Installed property
returns the correct value.

So use Installed="" or Not Installed as the condition of your commit custom
action for the first installation, and Installed<>"" or Installed as the
condition of your commit custom action for the upgrade.

If you're using VS to create the setup project, you coud specify the above
condition in the custom action's Condition property entry in the Properties
window.

Hope this helps.
If you have anything unclear, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

May 4 '07 #8
Linda,

I essentially have 2 custom actions set up -- each with a different action
that is performed, one for Installed and one for Not Installed. The problem
is if I run the installer against a previous version, Installed is not
evaluating to true.

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. If correct, that means the value of Installed is evaluated
after the previous version is uninstalled, but before the new version begins
installing.

I'm still stuck in the same place with this one.

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

Sorry that I made a mistake in my previous reply.

I was trying to get the value of the Installed property in a VB script
file
and create a commit custom action to run this VB script file in VS. The
content of the VB script file is like the following:
msgbox "Installed = " & Property("Insta lled")

When I install the MSI package for the first time, the message box pops up
showing an empty text. When I install the MSI package for the second time,
the message box pops up still showing an empty text.

I have read more about custom action later and realized that when a
deferred custom action is encountered, its condition is evaluated. If the
condition is met, the deferred custom action is written to the
installation
script, and will be executed later; otherwise, it is not added to the
installation script.

My previous test shows that when the deferrd custom action is executed,
the
value of the Installed property is an empty string. But my later test
shows
when the deferred custom action is encountered, the Installed property
returns the correct value.

So use Installed="" or Not Installed as the condition of your commit
custom
action for the first installation, and Installed<>"" or Installed as the
condition of your commit custom action for the upgrade.

If you're using VS to create the setup project, you coud specify the above
condition in the custom action's Condition property entry in the
Properties
window.

Hope this helps.
If you have anything unclear, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

May 19 '07 #9
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 #10

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

Similar topics

5
4924
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
2836
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
5854
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
8686
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
9173
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
9033
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
8911
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,...
0
7748
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5872
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
4375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.