RE: VS Setup project: detect install folder automatically?



Hi Steven,

You were right! There was a key in the registry that pointed to the install
path so I could use that value and specify an install folder which was a
subfolder of the path in the registry.

Thanks!

-Ben

"Steven Cheng[MSFT]" wrote:

Hello Ben,

From your description, you're developing an setup program for a VB.NET
winform program through the Visual Studio setup project. Currently you're
wondering how to copy some component/files into a destination directory and
the directory path is depend on an existing installed program(some certain
file) on the target machine,correct?

Based on my research, we have the following available approaches for such
scenario:

1. Since you will install those custom components(addin ...) into another
program's installation location, is that location available in the target
machine's registry. Most applications will store their installation root
path or any add-in storage path in the registry, if this is the case in
your scenario, you can consider use the "Registry Launch Condition" with a
Custom Folder that reference the detected registry value in the "Registry
Launch Condition" to do the task. Here is a MSDN article that demonstate
this approach:

#How to: Use a Registry Launch Condition to Specify a Target Directory
http://msdn2.microsoft.com/en-us/library/h0z89y5d.aspx


2. If #1 doesn't work for your case(the path isn't simply available through
a single registry value), we may need to use "File launch condition"
together with Custom Action to perform the work. Following is the complete
steps to do it:

1) use "File launch condition" and "Search file on target machine" to get
the directory path(we specify a proper Property name for the search which
will be referenced later in custom action).


2)Create a custom action assembly(with a Installer class), the installer
class will use the path passed from the previous action(search file on
target machine). And our custom components(which will be copied) can be put
in the same directory with custom action assembly so that we can easily
reference it in custom action class(see my test installer class).

3)Add the custom action (through the assembly, you can create it in a
standard class library project) into setup project, and set any necessary
parameter that need to pass into custom action through the
"CustomActionData" property. (see my attached image files)

To make it clearer, I've attached two screenshots about the "file launch
condition" and "custom action" setting and my test custom action class in
this message.(I test through Visual Studio 2005). You can get it if you're
using Outlook express to visit the NNTP newsgroup. Please let me know if
you have difficulty access the files.

In addition, here are some good articles and reference about using Custom
Action in VS setup project.


#A Custom Action for Deploying Visual Studio 2005 Add-in
http://www.codeproject.com/useritems/AddinCustomAction.asp

#Walkthrough: Creating a Custom Action
http://msdn2.microsoft.com/en-us/library/d9k65z2d.aspx

If you have anything unclear or any further questions on this, please feel
free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.

==================================================



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



Relevant Pages

  • Re: Print Spooler keeps stopping on a new Dell Latitude running XP SP2
    ... Microsoft Online Partner Support ... >If the issue persists after Registry modification as my previous reply, ... this issue may occur if the LexBCE custom printer driver from ... Reconnect the printer cable to the computer, install the printer ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: XP Service Pack 2 Issues??
    ... support centers listing they don't even have a support center for Office ... "Craig Alexander Morrison" wrote in message ... > the registry amendments. ... One of the features I sent with the install are two registry keys ...
    (microsoft.public.access.devtoolkits)
  • Re: Help with installation
    ... and from what I can understand I need to change something in my registry in order for this program to work. ... It's crazy not to be able to get support from MS for installation of trials versions. ... The problem with support is that the problem may be caused by something on the laptop such as other programs which may or may not be Microsoft and accordingly it may be difficult to diagnose. ... Then stop any unnecessary programs from running when you want to attempt the install by looking at the task list. ...
    (microsoft.public.project)
  • Re: Microsoft Update KB967715 Fails Continually After Reboot
    ... Manually found the registry key and ADDED the setting (see PABear's listing ... let it DL and "install". ... Start a free Windows Update support incident request: ... support for security updates is available through ...
    (microsoft.public.windowsupdate)
  • Re: Print Spooler keeps stopping on a new Dell Latitude running XP SP2
    ... If the issue persists after Registry modification as my previous reply, ... this issue may occur if the LexBCE custom printer driver from ... Reconnect the printer cable to the computer, install the printer ... Please note that the newsgroups are staffed weekdays by Microsoft Support ...
    (microsoft.public.windowsxp.help_and_support)

Loading