PDA

View Full Version : Automation interface for Merge Module



WISeAgent
06-21-2004, 10:01 PM
I've used the automation interface ISWiProject to package my msi and standard project in my autobuild script and it's proved to be very useful;)

I'm tring to automate the build of my merge module project using script, but I seems can't find the right interface to manipulate my merge module properties, such as productname, verion and location.

I'd like to know has anyone done it before, or can it be done at all?


any suggestion is much appreciated.


Regards,
W Wang

huntant
06-22-2004, 09:30 AM
Yes it is possible, here is a some sample code.

'=============================================
Set oProject = CreateObject( "ISWiAutomation.ISWiProject" )
oProject.OpenProject( sISMProject )

Set oProductConfig = oProject.ISWiProductConfigs.Item( sConfigName )
oProductConfig.ProductName = sProductName
oProductConfig.ProductVersion = sProductVersion
'=============================================

If you can debug your script through Visual Studio, you should be able to view all other available options for oProductConfig.



Anthony

WISeAgent
06-22-2004, 05:59 PM
I was under the impression that object "ISWiAutomation.ISWiProject" wasn't handling merge module. I've failed all the taskes attempted with merge module project. I've even ImportPoject function call:(

Actually, for the ImportProject function call, it returnes 0, but I've done SaveProject and no ism file was saved. It could be either Import or SaveProject failed.

It's a good idea to use Visual Studio, I'll give it a try and find out more about why it's failing.


Thanks for the suggestion.

Regards,
WWang

huntant
06-23-2004, 07:55 AM
That is strange that you are having problems with merge modules. The sample code is used by all projects that I build.

Do you have specific errors that you are encountering?




Anthony

WISeAgent
06-23-2004, 10:54 PM
I'm using perl script, which works perfect with my standard project for years. Now, the same func was used for both standard project and merge module project.

With standard project, both ImportProject, SaveProject, OpenProject return 0. and so far, I've got no problem update productname, version and packaging.

But for Merge module project, ImportProject appears to be working and returns 0, but OpenProject and SaveProject failed with no value returned. And I also can't find ism file which was supposed to be generated as a result of ImportProject call.

Teh following code snippet should be creating an ism file for me, but it doesn't work for the merge module project:(

-------------------------------------8<----------------------------------------
$oIS->ImportProject($myISMFileStr, $myISVFileStr);
$oIS->OpenProject($myISMFileStr, 0);
$oIS->SaveProject();
-------------------------------------8<----------------------------------------

huntant
06-24-2004, 07:12 AM
It almost sounds like the merge module project is failing to import properly. Just to double check, but have you tried to open the .isv manually? Is an .ism file created?



Anthony

WISeAgent
06-24-2004, 07:26 AM
The projects I've bee managing are stored in CVS, and only isv and idt files are saved into cvs. In my build script for standard project, I have to checkout isv and idt files from the CVS and use ImportProject to create an ism file from the isv file in the cvs. It's been working fine so far.

Back to your queston, It'll create an ism file correctly, if I double click to open isv file. It suggests that the isv file and idt files I retrived from CVS are correct.

I really got no idea what might go wrong;(

WISeAgent
06-28-2004, 06:28 AM
Thanks for help from huntant who find out the silly mistake I've made.

It happened that function ImportProject is expecting an .isv file with full path, and if the file is not found for whatever reason the call to ImportProject function call still returns S_OK. Once the correct arg is passed to the function, it works perfectly:-)


Regards,
WWang