dmilchev
Posts: 2
Joined: Fri Jul 05, 2013 11:50 am

Improve .aiproj files. Add support for central TFS builds

Hi guys,

Yesterday was my first encounter with your AI product. I appreciated its VS extension and .aiproj as they are the way to go.
But they are not suitable for out-of-the box builds in TFS, so:

Request 1
In case of TFS build, installer(s) produced must be placed in $(OutDir) or in sub-directory of it (configurable in .aip). This must happen by default.

Motivation: At TFS we have 2 folders per build: Source/(src) and Binaries/(bin). Sources contains data fetched from source control system, and Binaries contains artefacts produced by the build.
Build results (Binaries/bin) folder is exported by TFS to its consumers (via Drop folder).
Building installer under Source folder (next to .aip file) makes Installer missing from build results.

Request 2
.aiproj file contains hard-coded path (as at developer's machine) to Advanced Installer.

Scenario:
When Ai version changes (or developer installed AI at non-standard location), all .aiproj files must be edited in order to switch to location of new version.
This is error-prone and not scalable, as it may require modification of codelines already shipped to customers.

Requirement:
.aiproj file must automatically discover location of (latest version of) Advanced installer executable.
(This may happen via $([MSBuild]::GetRegistryValue()) or $(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Caphyon\Advanced Installer\...))
In case .aip files are not backwards-compatible location of required AI version must be found.

regards,
Delcho

P.S. Bellow are some workarounds and thoughts I tried in order to get installer files to $(OutDir)

[*] It is not possible to hard-code output path in .aip files, because it is different for local, TFS10 (folder named Binaries) and TFS11 builds (folder named bin).
[*] In editor for AIP files I was not able to find property which refer to Solution/project output directory, thus I am not able to create post-build event which publish installer to build results.
Anyway, such variable is available in .aiproj file $(OutDir), as it is set by msbuild workflow activity.
[*] No possibility to set this $(OutDir) property as parameter to AI in .aiproj file, as no such parameter exists for /build command (besides it is bad idea to edit generated project files, partly because they can be automatically overwritten)
[*] if $(OurDir) is set as Env.variable, it cannot be used as [%env_variables] as this syntax is available when .msi/.exe is being installed and not when build.

So I end with this workaround:
Appended these 2 lines before existing <Exec> task, at both Build and Rebuild targets:

Code: Select all

    <Exec Condition="'$(OutDir)'!=''" Command="attrib -R "%(Compile.Identity)"" />
    <Exec Condition="'$(OutDir)'!=''" Command=""$(AiComPath)" /edit "%(Compile.Identity)" /SetOutputLocation -buildname DefaultBuild -path "$(OutDir)"" />
(.aip file is R/O, as got from source control)

Anyway this is temporary workaround. It is not acceptable to enforce all developers to edit by hand .aiproj files and to require they have some understanding of msbuild specifics. This is error-prone and not scalable.
Also, these commands must be again changed by hand when "buildname" is changed or more builds are created.

P.S.S Dummy demo project attached, although not really required
Attachments
Demo.rar
Basic project with mentioned TFS workaround
(2.03 KiB) Downloaded 533 times
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Improve .aiproj files. Add support for central TFS build

Hello Delcho and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

I'll forward your request to our development team and maybe these improvements will be available in a future version of Advanced Installer. Thank you for your suggestion.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dmilchev
Posts: 2
Joined: Fri Jul 05, 2013 11:50 am

Re: Improve .aiproj files. Add support for central TFS build

For same scenario (build being able to work both locally and at TFS) we need to use SynchronizedFolders, but I am unable to find neither solution nor workaround.

I can add property or path variable this way (Please ignore the dummy values):
.... /edit XXX.aip /NewPathVariable -name SYNCFOLDER_SOURCEPATH -valuetype Folder -value d:\temp
.... /edit XXX.aip /SetProperty SYNCFOLDER_SOURCEPATH=d:\temp

I got them inside .aip file under components caphyon.advinst.msicomp.MsiPropsComponent and caphyon.advinst.msicomp.AppPathsComponent

I try to use them:
<COMPONENT cid="caphyon.advinst.msicomp.SynchronizedFolderComponent">
<ROW Directory_="APPDIR" SourcePath="[|SYNCFOLDER_SOURCEPATH]\blend\selector\selector\bin\Debug\de" Feature="MainFeature" ExcludePattern="*~|#*#|%*%|._|CVS|*.pdb" ExcludeFlags="6"/>

I got "The source folder "d:\MYPATHS\[|SYNCFOLDER_SOURCEPATH]\blend\selector\selector\bin\Debug\de" of the synchronized folder "APPDIR" is missing from disk. You need to ..."

Why are variables/paths not expanded? If problem is with component domains, how can I add path/property to a place where it would be visible and expanded by SynchronizedFolders?

-----
Edit: Quick workaround from your side could be that "/NewSync" command updates current sync folder if exists instead complaining that This folder is already synchronized
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Improve .aiproj files. Add support for central TFS build

Hello,

The "Team Foundation Server (TFS) integration" feature has been added in version 11.4 of Advanced Installer released on July 30th, 2014.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Feature Requests”