Installer Project - Conditions on Custom Action

  • Thread starter Thread starter Simon Verona
  • Start date Start date
S

Simon Verona

I have an installer project for my VB.net application which as a custom
action runs a silent installation of a third party software product.

This however, generates an error if the application is already installed.

I therefore want to check if the application is already installed before
launching the setup.exe to install it.

I know I use the "condition" property on the custom action - but what
exactly do I put in as a condition if I want to check for a file existing
and if it is to not run the setup.exe?

Thanks in advance
Simon

--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD

Tel: 0870 080 2300
Fax: 0870 735 0011
 
If a launch condition fails i.e the check returns false, you will get a
message and setup will fail. This is how the installer works. If you are
sure that administrators will install the application then you can put a
registry key and then use that key to check if you are application is
installed, in the launch condition. This will be easy, as you don't have to
do custom actions for this. Let me know if you need more help

VJ
 
I'd like to put in a test to see if a specific file exists on the system -
on the basis that if it is then the application is installed... What
exactly would I put in to achieve this ?

Thanks
Simon

--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD

Tel: 0870 080 2300
Fax: 0870 735 0011
 
Simon...

You don't have to put in a file check.., you can use the registry to create
a Unique key with your company/prd name.. like that under HKLM when
installing and as part of Launch check...you can check for this.. Registry
is also guaranteed to be unique if you have company name in there... File
Search, unless you are installing files at a specific location of your own,
will hard to track, if user has different drive letter etc...

I hope you can create a Reg key for a setup project...Assuming this is
done... and you have created a key as

HKLM\MyCompany\MyProduct\
Application Name - "MyProduct"
AppInstalled Path - [TARGETDIR]

Here is how you can create a Launch check for the registery key...

Creating Search Conditon..
==================

In the launch condition window for setup project... Right click on the
Search Target Machine.
Choose Add Registery search..
Set the following properties..for the Item

(Name) - RegMyProduct
Property - MyProductCheck
RegKey - SOFTWARE\MyCompany\MyProduct
Root - vsdrrHKLM
Value - Application Name

In the same window... Right Click on Launch condtions...and Add Launch
Condition.. set properties as below for the new item

(Name) - MyNewProductCheck
Condition - MyProductCheck=""
InstallURL - <Leave this empty>
Message - <Custom Message to say your product is already installed>

The above will make sure that your application won't install on machine
already installed...

HTH
VJ
 
Thanks I figured the relationship between "launch conditions" and
"Custom action properties" just before your post.

Thanks for taking the time - creating installers seems to be very poorly
documented!

Regards
Simon

--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD

Tel: 0870 080 2300
Fax: 0870 735 0011

Vijay said:
Simon...

You don't have to put in a file check.., you can use the registry to
create a Unique key with your company/prd name.. like that under HKLM when
installing and as part of Launch check...you can check for this.. Registry
is also guaranteed to be unique if you have company name in there... File
Search, unless you are installing files at a specific location of your
own, will hard to track, if user has different drive letter etc...

I hope you can create a Reg key for a setup project...Assuming this is
done... and you have created a key as

HKLM\MyCompany\MyProduct\
Application Name - "MyProduct"
AppInstalled Path - [TARGETDIR]

Here is how you can create a Launch check for the registery key...

Creating Search Conditon..
==================

In the launch condition window for setup project... Right click on the
Search Target Machine.
Choose Add Registery search..
Set the following properties..for the Item

(Name) - RegMyProduct
Property - MyProductCheck
RegKey - SOFTWARE\MyCompany\MyProduct
Root - vsdrrHKLM
Value - Application Name

In the same window... Right Click on Launch condtions...and Add Launch
Condition.. set properties as below for the new item

(Name) - MyNewProductCheck
Condition - MyProductCheck=""
InstallURL - <Leave this empty>
Message - <Custom Message to say your product is already installed>

The above will make sure that your application won't install on machine
already installed...

HTH
VJ

Simon Verona said:
I'd like to put in a test to see if a specific file exists on the
system - on the basis that if it is then the application is installed...
What exactly would I put in to achieve this ?

Thanks
Simon

--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD

Tel: 0870 080 2300
Fax: 0870 735 0011
 
Yea I agree with you totally....Also watch out on the dependency refresh.
Double check depended files everytime you build.. I have been bit bad,
specially if you use third party components in the project.

VJ

Simon Verona said:
Thanks I figured the relationship between "launch conditions" and
"Custom action properties" just before your post.

Thanks for taking the time - creating installers seems to be very poorly
documented!

Regards
Simon

--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD

Tel: 0870 080 2300
Fax: 0870 735 0011

Vijay said:
Simon...

You don't have to put in a file check.., you can use the registry to
create a Unique key with your company/prd name.. like that under HKLM
when installing and as part of Launch check...you can check for this..
Registry is also guaranteed to be unique if you have company name in
there... File Search, unless you are installing files at a specific
location of your own, will hard to track, if user has different drive
letter etc...

I hope you can create a Reg key for a setup project...Assuming this is
done... and you have created a key as

HKLM\MyCompany\MyProduct\
Application Name - "MyProduct"
AppInstalled Path - [TARGETDIR]

Here is how you can create a Launch check for the registery key...

Creating Search Conditon..
==================

In the launch condition window for setup project... Right click on the
Search Target Machine.
Choose Add Registery search..
Set the following properties..for the Item

(Name) - RegMyProduct
Property - MyProductCheck
RegKey - SOFTWARE\MyCompany\MyProduct
Root - vsdrrHKLM
Value - Application Name

In the same window... Right Click on Launch condtions...and Add Launch
Condition.. set properties as below for the new item

(Name) - MyNewProductCheck
Condition - MyProductCheck=""
InstallURL - <Leave this empty>
Message - <Custom Message to say your product is already installed>

The above will make sure that your application won't install on machine
already installed...

HTH
VJ

Simon Verona said:
I'd like to put in a test to see if a specific file exists on the
system - on the basis that if it is then the application is installed...
What exactly would I put in to achieve this ?

Thanks
Simon

--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD

Tel: 0870 080 2300
Fax: 0870 735 0011

If a launch condition fails i.e the check returns false, you will get a
message and setup will fail. This is how the installer works. If you
are sure that administrators will install the application then you can
put a registry key and then use that key to check if you are
application is installed, in the launch condition. This will be easy,
as you don't have to do custom actions for this. Let me know if you
need more help

VJ

I have an installer project for my VB.net application which as a custom
action runs a silent installation of a third party software product.

This however, generates an error if the application is already
installed.

I therefore want to check if the application is already installed
before launching the setup.exe to install it.

I know I use the "condition" property on the custom action - but what
exactly do I put in as a condition if I want to check for a file
existing and if it is to not run the setup.exe?

Thanks in advance
Simon

--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD

Tel: 0870 080 2300
Fax: 0870 735 0011
 
Back
Top