Can't build a configuration using CMI

  • Thread starter Thread starter Mikhail Mintchenkov
  • Start date Start date
M

Mikhail Mintchenkov

Hi all,

I've a simple script based on example from CMIEXP.WSF.
It runs OK (no error messages) but no output files are in C:\FOO.
Build of solution.slx using Target Designer runs OK and produces a valid
image.

How can error be detected?


DBOPEN setup
NEW cfg Config
load cfg solution.slx
cfg.build 0, "c:\foo"

Kind Regards,
Mikhail
 
Mikhail,

I may be wrong but Config.build will only invoke cmiOnBuild of the Configuration which usually just sets up hives and updates
boot.ini to add the configuration specific options. It does not *build* the project.

I think for building a project with a CMIExp script (or a WSH, a VBS, etc. script) you will have to create a script procedure to
enumerate all the instances in the Config, compute the proper build order, and let each instance to build itself through cmiOnBuild.
(and there is more event handlers you will have to invoke when it comes to details)

TD, however, sets up its own handler for the Config.cmiOnBuild which does what I described above.
 
Hi, KM,

It seems that its not a simple task
Do you know how to build concret instance?

M.M.




KM said:
Mikhail,

I may be wrong but Config.build will only invoke cmiOnBuild of the
Configuration which usually just sets up hives and updates
boot.ini to add the configuration specific options. It does not *build* the project.

I think for building a project with a CMIExp script (or a WSH, a VBS, etc.
script) you will have to create a script procedure to
enumerate all the instances in the Config, compute the proper build order,
and let each instance to build itself through cmiOnBuild.
 
Mikhail,

Well.. As I mention the building a particular instance is as "simple" as computing its build order, building its resources (most
tedious coding step as of some different possible types of component resources), calling cmiOnBeginBuild/cmiOnBuild/cmiOnEndBuild
scripts of the component. There is also some exceptions for particular components but this is not important for you now.

Why do you need that? To automate a project build process?
 
KM,

Yes, I'm looking for the way to automate the procedure of building....
(I'm was connfused to know that there are no open solution for it)

Actually the schema of building the project is:
1) Find order of components building. (in dependency order?)
2) Build each component
3) Build resources of component, if any (most tedious step, as you wrote).

Am I right?

M.M.


Mikhail,

Well.. As I mention the building a particular instance is as "simple" as
computing its build order, building its resources (most
tedious coding step as of some different possible types of component
resources), calling cmiOnBeginBuild/cmiOnBuild/cmiOnEndBuild
scripts of the component. There is also some exceptions for particular
components but this is not important for you now.
 
Mikhail,

You are almost right in the steps below. A few corrections, though.
I was referring to Build order of a component, not Dependency related.

Also, any component may be assigned (amd most MS software component are) with a custom CMI script. So you do want to call a
component cmiOnBeginBuild and cmiOnEndBuild handlers if set.

Basically the TD build process is as follows (certainly just a guess of mine):
- Loop through all instances (Base Instance first). For each instance:
- Call cmiOnBeginBuild
- Compute Configuration instance build order
- Loop through all instances. For each instance:
- Call cmiOnBuild to let the instance build itself
- The cmiOnBuild will call to cmiOnBuildResource for each resource item that belongs to the instance
- The instance's cmiOnBuild will call the cmiOnBuild script of prototype component. That will end up with
Default Prototype Component cmiOnBuild script.
- Call Configuration's cmiOnBuildResource for each resource item that belongs to the Configuration
- Loop through all instances (Base Instance last). For each instance:
- Call cmiOnEndBuild

This is just my understanding of the process. Someone from Microsoft who's got access to the CMI classes and TD source code may
answer your questions better.

KM
 
Back
Top