NB: I'm kind of new to Advanced Installer so I might be talking crazy about some stuff, don't hesitate on telling me about it.
Preamble
I work for THALES EPM and my company chose AI to generate all the installation packages of the project I'm working on. I've been assigned the responsability to setup the MSI build process.
The project contains about 40 to 50 different software applications, each one with their installation package. And therefore different needs : prerequisites, files, shortcuts, registry keys/values, custom actions, etc. All the applications of the project are built through continuous integration on a Hudson server, and I'd like to integrate the MSI packaging in Hudson (fully automated builds triggered by Source Code Management events)
Considering all this, the .aip project files cannot be managed in the GUI version of advanced installer. All must be done from the command line interface by maintaining one Advanced Installer script for each application of the project. All applications must share the same .aip template.
My questions
I've set up a test run with this .aip template file:
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DOCUMENT Type="Advanced Installer" CreateVersion="8.0.2" version="8.0.2" Modules="professional" RootPath="." Language="en">
<COMPONENT cid="caphyon.advinst.msicomp.MsiPropsComponent">
<ROW Property="ALLUSERS" Value="2"/>
<ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|ProductName]." ValueLocId="*"/>
<ROW Property="BannerBitmap" MultiBuildValue="DefaultBuild:banner_image.jpg" Type="1"/>
<ROW Property="DialogBitmap" MultiBuildValue="DefaultBuild:dialog_image.jpg" Type="1"/>
<ROW Property="Manufacturer" Value="My Company" ValueLocId="*"/>
<ROW Property="ProductCode" Value="1033:{F9C7EAE6-D1A1-439A-8722-6BD86B067C24} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="My Product" ValueLocId="*"/>
<ROW Property="ProductVersion" Value="1.0.0"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
<ROW Property="UpgradeCode" Value="{F3E30318-2281-4AE5-8D00-4B68075A65CC}"/>
<ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/>
<ROW Property="WindowsType9XDisplay" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.BuildComponent">
<ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="D:" PackageFileName="setup" Languages="en" InstallationType="4"/>
<ATTRIBUTE name="CurrentBuild" value="DefaultBuild"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent">
<ROW Path="<AI_DICTS>ui.ail"/>
<ROW Path="<AI_DICTS>ui_en.ail"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.FragmentComponent">
<ROW Fragment="CommonUI.aip" Path="<AI_FRAGS>CommonUI.aip"/>
<ROW Fragment="FolderDlg.aip" Path="<AI_THEMES>classic\fragments\FolderDlg.aip"/>
<ROW Fragment="SequenceDialogs.aip" Path="<AI_THEMES>classic\fragments\SequenceDialogs.aip"/>
<ROW Fragment="Sequences.aip" Path="<AI_FRAGS>Sequences.aip"/>
<ROW Fragment="StaticUIStrings.aip" Path="<AI_FRAGS>StaticUIStrings.aip"/>
<ROW Fragment="UI.aip" Path="<AI_THEMES>classic\fragments\UI.aip"/>
<ROW Fragment="Validation.aip" Path="<AI_FRAGS>Validation.aip"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiBinaryComponent">
<ROW Name="aicustact.dll" SourcePath="<AI_CUSTACTS>aicustact.dll"/>
<ROW Name="banner_image.jpg" SourcePath="<AI_THEMES>classic\resources\banner-image.jpg"/>
<ROW Name="dialog_image.jpg" SourcePath="<AI_THEMES>classic\resources\dialog-image.jpg"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiControlComponent">
<ATTRIBUTE name="FixedSizeBitmaps" value="0"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiControlEventComponent">
<ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="FolderDlg" Condition="AI_INSTALL" Ordering="201"/>
<ROW Dialog_="WelcomeDlg" Control_="Next" Event="NewDialog" Argument="FolderDlg" Condition="AI_INSTALL" Ordering="1"/>
<ROW Dialog_="VerifyReadyDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_INSTALL" Ordering="197"/>
<ROW Dialog_="FolderDlg" Control_="Next" Event="NewDialog" Argument="VerifyReadyDlg" Condition="AI_INSTALL" Ordering="201"/>
<ROW Dialog_="FolderDlg" Control_="Back" Event="NewDialog" Argument="WelcomeDlg" Condition="AI_INSTALL" Ordering="1"/>
<ROW Dialog_="MaintenanceTypeDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceWelcomeDlg" Condition="AI_MAINT" Ordering="1"/>
<ROW Dialog_="MaintenanceWelcomeDlg" Control_="Next" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT" Ordering="99"/>
<ROW Dialog_="CustomizeDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT" Ordering="1"/>
<ROW Dialog_="MaintenanceTypeDlg" Control_="ChangeButton" Event="NewDialog" Argument="CustomizeDlg" Condition="AI_MAINT" Ordering="301"/>
<ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="CustomizeDlg" Condition="AI_MAINT" Ordering="202"/>
<ROW Dialog_="CustomizeDlg" Control_="Next" Event="NewDialog" Argument="VerifyReadyDlg" Condition="AI_MAINT" Ordering="1"/>
<ROW Dialog_="VerifyReadyDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_MAINT" Ordering="198"/>
<ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="PatchWelcomeDlg" Condition="AI_PATCH" Ordering="203"/>
<ROW Dialog_="PatchWelcomeDlg" Control_="Next" Event="NewDialog" Argument="VerifyReadyDlg" Condition="AI_PATCH" Ordering="201"/>
<ROW Dialog_="VerifyReadyDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_PATCH" Ordering="199"/>
<ROW Dialog_="ResumeDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_RESUME" Ordering="299"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiCustActComponent">
<ROW Action="AI_DOWNGRADE" Type="19" Target="4010"/>
<ROW Action="AI_PREPARE_UPGRADE" Type="65" Source="aicustact.dll" Target="PrepareUpgrade"/>
<ROW Action="AI_RESTORE_LOCATION" Type="65" Source="aicustact.dll" Target="RestoreLocation"/>
<ROW Action="AI_ResolveKnownFolders" Type="1" Source="aicustact.dll" Target="AI_ResolveKnownFolders"/>
<ROW Action="AI_STORE_LOCATION" Type="51" Source="ARPINSTALLLOCATION" Target="[APPDIR]"/>
<ROW Action="SET_APPDIR" Type="307" Source="APPDIR" Target="[ProgramFilesFolder][Manufacturer]\[ProductName]"/>
<ROW Action="SET_SHORTCUTDIR" Type="307" Source="SHORTCUTDIR" Target="[ProgramMenuFolder][ProductName]"/>
<ROW Action="SET_TARGETDIR_TO_APPDIR" Type="51" Source="TARGETDIR" Target="[APPDIR]"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiInstExSeqComponent">
<ROW Action="AI_DOWNGRADE" Condition="AI_NEWERPRODUCTFOUND AND (UILevel <> 5)" Sequence="210"/>
<ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=""" Sequence="749"/>
<ROW Action="AI_STORE_LOCATION" Condition="Not Installed" Sequence="1501"/>
<ROW Action="AI_PREPARE_UPGRADE" Condition="AI_UPGRADE="No" AND (Not Installed)" Sequence="1399"/>
<ROW Action="AI_ResolveKnownFolders" Sequence="51"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiInstallUISequenceComponent">
<ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=""" Sequence="749"/>
<ROW Action="AI_ResolveKnownFolders" Sequence="51"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiLaunchConditionsComponent">
<ROW Condition="VersionNT" Description="[ProductName] cannot be installed on [WindowsType9XDisplay]" DescriptionLocId="AI.LaunchCondition.No9X" IsPredefined="true" Builds="DefaultBuild"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiThemeComponent">
<ATTRIBUTE name="UsedTheme" value="classic"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiUpgradeComponent">
<ROW UpgradeCode="[|UpgradeCode]" VersionMax="[|ProductVersion]" Attributes="1025" ActionProperty="OLDPRODUCTS"/>
<ROW UpgradeCode="[|UpgradeCode]" VersionMin="[|ProductVersion]" Attributes="2" ActionProperty="AI_NEWERPRODUCTFOUND"/>
</COMPONENT>
</DOCUMENT>Code: Select all
;aic
SetProperty Company="Thales"
SetProperty Division="EPM"
SetProperty Manufacturer="My Project Name"
SetProperty TARGETDIR="C:\[|Manufacturer]\[|Company]"
SetProperty AI_PRODUCTNAME_ARP="[|Manufacturer] - [|ProductName] [|ProductVersion]"
SetProperty ARPCONTACT="support.myproject@thalesgroup.com"
SetProperty ARPHELPLINK="http://my.help.url"
SetProperty ARPHELPTELEPHONE="+33 1 00 00 00 00"
SetProperty ARPPRODUCTICON="C:\full\path\to\app\icon.ico"
SetProperty ARPURLINFOABOUT="http://my.about.url"
SetBitmap -banner D:\resources\images\banner-image.bmp -dialog D:\full\path\to\dialog-image.bmp
SetProperty ProductName="SomeProduct"
SetProperty BuildNumber="20110218125422"
SetVersion 2.8.0 -noprodcode
AddFolder APPDIR\[|ProductName] D:\work_dir\package\doc
AddFolder APPDIR\[|ProductName] D:\work_dir\package\examples
AddFolder APPDIR\[|ProductName] D:\work_dir\package\source
AddFile APPDIR\[|ProductName] D:\work_dir\package\some_script.pl
AddFile APPDIR\[|ProductName] D:\work_dir\package\README.txt
AddFile APPDIR\[|ProductName] D:\work_dir\package\myproduct.exe
AddFile APPDIR\[|ProductName] D:\work_dir\package\myproduct-debug.exe
NewShortcut -name "My Product User Manual" -dir SHORTCUTDIR -target APPDIR\doc\myproduct-manual.pdf -icon D:\resources\icons\PDFFile.ico -mode normal
NewShortcut -name "My Product README" -dir SHORTCUTDIR -target APPDIR\README.txt -icon D:\resources\icons\PDFFile.ico -mode normal
NewReg -RegValue HKLM\Software\[Company]\[Division]\[Manufacturer]\[ProductName]\ProductVersion -data #%[ProductVersion]
NewReg -RegValue HKLM\Software\[Company]\[Division]\[Manufacturer]\[ProductName]\BuildNumber -data #%[BuildNumber]
SetPackageName D:\work_dir\myproduct-2.8.0.20110218125422.msi
ReBuildCode: Select all
AdvancedInstaller.com /execute D:\work_dir\global_template.aip D:\work_dir\advancedinstaller.script
SetProperty Company="My Company"
SetProperty Division="My Division"
SetProperty Manufacturer="My Project Name"
SetProperty TARGETDIR="C:\[|Manufacturer]\[|Company]"
SetProperty AI_PRODUCTNAME_ARP="[|Manufacturer] - [|ProductName] [|ProductVersion]"
SetProperty ARPCONTACT="support@mycompany.com"
SetProperty ARPHELPLINK="http://my.help.url"
SetProperty ARPHELPTELEPHONE="+33 1 00 00 00 00"
SetProperty ARPPRODUCTICON="C:\full\path\to\app\icon.ico"
SetProperty ARPURLINFOABOUT="http://my.about.url"
SetBitmap -banner D:\resources\images\banner-image.bmp -dialog D:\full\path\to\dialog-image.bmp
SetProperty ProductName="MyProduct"
SetProperty BuildNumber="20110218125422"
SetVersion 2.8.0 -noprodcode
AddFolder APPDIR\[|ProductName] D:\work_dir\package\doc
AddFolder APPDIR\[|ProductName] D:\work_dir\package\examples
AddFolder APPDIR\[|ProductName] D:\work_dir\package\source
AddFile APPDIR\[|ProductName] D:\work_dir\package\some_script.pl
AddFile APPDIR\[|ProductName] D:\work_dir\package\README.txt
AddFile APPDIR\[|ProductName] D:\work_dir\package\myproduct.exe
AddFile APPDIR\[|ProductName] D:\work_dir\package\myproduct-debug.exe
NewShortcut -name "My Product User Manual" -dir SHORTCUTDIR -target APPDIR\doc\myproduct-manual.pdf -icon D:\resources\icons\PDFFile.ico -mode normal
NewShortcut -name "My Product README" -dir SHORTCUTDIR -target APPDIR\README.txt -icon D:\resources\icons\PDFFile.ico -mode normal
NewReg -RegValue HKLM\Software\[Company]\[Division]\[Manufacturer]\[ProductName]\ProductVersion -data #%[ProductVersion]
NewReg -RegValue HKLM\Software\[Company]\[Division]\[Manufacturer]\[ProductName]\BuildNumber -data #%[BuildNumber]
SetPackageName D:\work_dir\myproduct-2.8.0.20110218125422.msi
ReBuild
[ DefaultBuild ]
Building package (en): D:\work_dir\myproduct-2.8.0.20110218125422.msi
Creating CAB file(s)... done.
Creating MSI database... done.
Inserting CAB file(s) into MSI... done.
Writing Summary Information... done.
Build time: 1 sec.
Total build time: 1 sec.
Build finished successfully.- How do I change the shortcut creation location to : [ProgramMenuFolder][Manufacturer]\[ProductName] instead of the default value [ProgramMenuFolder][ProductName] ?
- Instead of adding every file and folder separately, can I just tell AI to take everything from some location and put it in the APPDIR ?
- How do I add custom actions from the command line ?
Robin
FOLLOW US
Get the latest news in Application Packaging