Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

SourceDir


3 replies to this topic

LLL

LLL
  • Members
  • 7 posts

Posted 01 June 2001 - 18:04

I am creating a custom action on setting up a property for MDAC. What should I put in the "target" column? What is the default SourceDir? What does the target referring to? Is it where the mdac files are stored?Thanks in advance.

Irina

Irina
  • Members
  • 227 posts

Posted 05 June 2001 - 15:06

Hi,
What do you want with MDAC. If you want to install use Merge Modules. The field "target" consits usually cmd line parameters  or  van be blank.

SteveP

SteveP
  • Members
  • 126 posts

Posted 08 June 2001 - 00:01

Depending on where your MDAC source file is, you can use any of several methods to install.  Merge Modules is one option, but not necessarily the best.

Let's say, just for argument, that you are installing from a CD, and that your MSI file exists in the root folder on the CD.  In that case, [SourceDir] points to the root folder of the CD ... no matter what the drive letter may be.  All other paths on the CD may be resolved relative to [SourceDir].

Similarly, if you are installing from a network image, then [SourceDir] may point to something like \\SomeServer\SomeShare\SomeFolder\...\, the complete path to your MSI file.  I use this method to place a mockup of my CD on one of the build machines and install from that image.

Now, let's further say that you have a copy of the mdac_typ.exe file in a folder on your source image, and that it exists in a folder named MDAC one level below your MSI file.  Then the path to the exe would be [SourceDir]MDAC\mdac_typ.exe.  Please note that there is no slash (\) after [SourceDir] because the installer automatically puts one in there.  

The next item is to decide what you want to do with your CA.  If your entire effort is going to be aimed at installing the package, then you can use a Type 51 CA to set a property to the path we have been discussing and then use a Type 50 CA to launch the executable.  This is relatively handy because it allows you to specify a command line for the exe file.

The meanings of the Source and Target fields of the CA table vary depending on what kind of CA you have written.  For example, I often include CA Type 38/1062 into my test packages to display a message box telling me how far through the execute sequence I have come.  If I am including the CA into the sequence prior to InstallInitialize, I use the type 38 ... for deferred CA's I use the type 1062.  The record syntax could then be:

Type:  38
Source:  NULL (leave blank)
Target:  MsgBox "My Message"

On the other hand, if you are using a Type 50 CA, the Source is the name of the property that contains the full path to the executable.  So a CA of that type could look like:

Type:  50
Source:  WScript <A property containing the path to WScript>
Target:  //B "[ProgramFiles]ScriptFolder\MyScript.vbs" <Arg0> <Arg1> ... <Argn>

Note that the Type 50 uses the Target to contain the command line arguments, and for WScript.exe, that means the switches, the full path and name to the script file, and any arguments you are passing to the script.  

Since it may be difficult to define the location of the scripting host by hard coding (it may not be on Drive C), I sometimes use the type 34 Custom Action.  In that case, the Source contains the name of a defined Directory ([SystemFolder], for example] and the Target contains the name of the exe plus any command line arguments.

You may want to review the documentation on Custom Actions in the MsiIntel.SDK available through MSDN.  If you have additional questions on this issue, please drop me an email.


LLL

LLL
  • Members
  • 7 posts

Posted 11 June 2001 - 16:27

Steve,
   Thank you very much for your help and your detail explanation. It really helps a lot, getting me into the picture