
squiddog asked a question.
Automated nightly builds with script-based installer?
Is this possible?
We have complex (Installshield 2010-2011) script-based installers that also invoke other installshield object projects (both homemade and provided by IS). We use batch files to get source code and build our visual studio projects, but right now when we do the Installshield part we strictly use the GUI because we want to make sure there were no errors, but also because we need to update the build number every time. As far as I know there is no batch or automated way to do this.
Can anyone suggest a way to do nightly automated builds in this scenario? I would really love to kick off nightly builds at 3 AM or whatever, even if I had to use a batch file.
Thanks.
An example would be:
Product Version: 1.12.0007
Our defines:
PRODUCT_VERSION = 1.1200
PRODUCT_BUILD = 7
You might say to read in product version and parse it... but they do not always line up due to alpha or beta releases etc.
Is there a way to communicate a new version and build number to my script? Perhaps there is a way to create custom system variables and set them?
Thanks.
But aside from that, I think I've got my answer. Thanks!
echo define BUILDNUM "%BUILD_LABEL%" > "%BUILD_DIR%\Install\Script Files\buildnum.h"
An InstallScript CA calls
MsiSetProperty( hMSI, "BUILDNUMBER", BUILDNUM );
Obviously our build script sets %BUILD_LABEL%.
Thanks.
Can anyone elaborate on how they're using the automation interface to update the version number? "
Here is a direct route via Perl script:
sub UpdateIS2010ProductVersion {
my ($projectPath, $projectName, $projectVersion) = @_;
my $projectFile = File::Spec->catfile($projectPath, $projectName . ".ism");
print "\nUpdating Product Version for $projectFile to $projectVersion\n";
instantiate the Developer Automation interface
my $isDAI = Win32::OLE->new("IswiAuto16.ISWiProject");
open a project as read-write
my $res = $isDAI->OpenProject($projectFile, 0);
if ( $res != 0 ) {
die qq(\nERROR: Could not open Installshield project.);
}
Change the Version
$isDAI->SetProperty("ProductVersion", $projectVersion);
$isDAI->SaveProject( );
$isDAI->CloseProject( );
clean up
undef $isDAI;
}
Alternatively, here's a more generic function that allows you to update any property:
-------------------------------------------------------------------------------
Description: Update a Property in an InstallShield project.
Inputs : Path to the ISM file
File Name without .ism
Property to be updated
Value to be inserted into the Property
InstallShield project version
-------------------------------------------------------------------------------
sub UpdateProperty {
my $function = "UpdateProperty";
my ($projectPath, $projectName, $PropertyName, $PropertyValue, $sISver) = @_;
my $projectFile = File::Spec->catfile( $projectPath, $projectName . ".ism" );
print "\nUpdating the $PropertyName Property for $projectFile to $PropertyValue\n";
my $isProject;
if ($sISver eq "12") {
$isProject = Win32::OLE->new("IswiAuto12.ISWiProject");
} elsif ($sISver eq "10.5") {
$isProject = Win32::OLE->new("IswiAuto1050.ISWiProject");
} elsif ($sISver eq "2010") {
$isProject = Win32::OLE->new("IswiAuto16.ISWiProject");
} elsif ($sISver eq "2011") {
$isProject = Win32::OLE->new("IswiAuto17.ISWiProject");
} else {
die ("$function: InstallShield version wasn't passed!");
}
open a project as read-write
my $res = $isProject->OpenProject($projectFile, 0);
if ($res != 0) {
die qq(\n$function: Could not open Installshield project!\n);
}
Change the Property's value:
$isProject->SetProperty($PropertyName, $PropertyValue);
$isProject->SaveProject();
$isProject->CloseProject();
clean up
undef $isProject;
}
Disclaimer: I haven't used these functions with IS versions older than IS2010. I left the older versions there as information...they might not work (I don't seem to be able to update Path Variables in 10.5 projects this way, for instance).