all groups > visual studio .net setup > august 2005 >
You're in the

visual studio .net setup

group:

launch conditions


launch conditions docschnipp
8/2/2005 4:15:04 AM
visual studio .net setup:
Hi,

i'd like to check several possible registry values for a possible TARGETDIR.
How can I do this with Launch Conditions?

It seems that only 1 of the 2 Registry Searches are performed, and I can
also not influence the order in which they are listed except by alphabetising
them?

Am I understanding this mechanism wrong?

thanks for any answer
doc
RE: launch conditions docschnipp
8/3/2005 3:44:04 AM
Hello,

thanks for the answer, this at helped a bit, but there are still confusing
things going on:

[quoted text, click to view]

I've checked for that, but it is not exactly the thing I need. The logic
should be:

A) check for regkey A and if existent copy the value to TARGETDIR
B) check for regkey B and if existent copy the value to TARGETDIR

B is more important as A (A is a legacy key from another product, B is the
last install path from THIS product)

How can I determine the order in which these are executed, so B can override
A?

[quoted text, click to view]

There is also some confusion, things like "[ProductName]" do not work
uppercase, only in the way they're defined in the property table, right?

There is also showing up another problem:
I create a registry value during installation, but when I install the
upgrade, it deinstalls the previous version and deletes the registry key
despite I marked it "DeleteAtUninstall = false". Is this a bug or do I have
to tweak with the "Transient" property (I understood it that "Transient" is
only neccessary when there is a CONDITION given, right?)?

thanks

doc
RE: launch conditions docschnipp
8/3/2005 3:56:03 AM
Hello,

I have a small addendum to the previous post:

[quoted text, click to view]

Is it the way to be that if I change the version that I should NOT change
the product code to get the desired behaviour of the deinstallation of the
previous version?

thanks

doc
RE: launch conditions v-garych NO[at]SPAM online.microsoft.com (
8/3/2005 8:09:46 AM
Hi doc,

[quoted text, click to view]

A Registry launch condition can be used to search for a required registry
key or value, this value can then be used to set a property in an installer
during installation.

Please refer to the following MSDN example on how to use a registry search
to determine the target directory for a file.

Using a Registry Launch Condition to Specify a Target Directory
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/ht
ml/vxtskusingregistrysearchtospecifytargetdirectory.asp


[quoted text, click to view]

All the registry searches should be performed in the installation progress,
but you may need to specify an item under the target registry key which you
concerned, by the way the property name should be uppercase.


Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Re: launch conditions Phil Wilson
8/3/2005 2:53:19 PM
You can't really do that search/set TARGETDIR thing with VS setups. The way
I've done something similar this is to use a custom folder that has the
property value discovered by the registry search, defaulting to TARGETDIR.
Having another level of default if one registry search fails might be
p9ossible with another custom folder, but I don't think so. The short
answer is that you get VS setups free with Visual Studio, and there's a
reason that tools from InstallShield, Wise etc are not free - you can do
more with them, like what you are trying to do. Wix would let you do that
too with some custom actions in the right place.

ProductName is a case-sensitive Windows Installer property. It's not often
clear in a Visual Studio setup project, but the property list is documented
here, and yes they are case-sensitive.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/properties.asp

Something else that might not be obvious, but VS upgrades using
RemovePreviousVersions are Windows Installer major upgrades, and yes, that
means that the old product is uninstalled then the new one is installed.
Apart from that, I think the problem you're seeing is that I think maybe
DeleteAtUninstall applies to data values under the key, not the key itself
(despite what the VS IDE implies) so you might find that they stay behind if
you mark each data item DeleteAtUninstall = False.

These may help in general:
http://www.simple-talk.com/2005/04/25/getting-started-with-setup-projects/
http://www.simple-talk.com/2005/06/07/visual-studio-setup/
http://www.simple-talk.com/2005/07/18/updates-to-setup-projects/

--
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view]

AddThis Social Bookmark Button