Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Setup / August 2005

Tip: Looking for answers? Try searching our database.

launch conditions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
docschnipp - 02 Aug 2005 12:15 GMT
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
"Gary Chang[MSFT]" - 03 Aug 2005 09:09 GMT
Hi doc,

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

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

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

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.
docschnipp - 03 Aug 2005 11:44 GMT
Hello,

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

> 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

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?

> 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.

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
docschnipp - 03 Aug 2005 11:56 GMT
Hello,

I have a small addendum to the previous post:

> 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?)?

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
Phil Wilson - 03 Aug 2005 22:53 GMT
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/prope
rties.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/

Signature

Phil Wilson [MVP Windows Installer]
----

> Hello,
>
[quoted text clipped - 43 lines]
>
> doc

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.