thill
Posts: 111
Joined: Sat Jan 21, 2012 5:58 pm

/GetProperty command causes file scan

To solve the problem of browsers caching JavaScript and other files we are now including a 4-place version in those filenames, e.g. file-1.4.7.2.js, and is done between building and staging our files and building the installer.

The build sequence uses an Ant script to pull the 4-place ProductVersion string from the Advanced Installer project file using /GetProperty. Then files are renamed and references to them substituted in the appropriate text-based (not compiled) files. Then the installer is built.

The problem --

When getting the ProductVersion with /GetProperty before renaming files Advanced Installer is scanning the staged (not yet renamed) files and adding new components for them. But those files are about to be renamed. So everything isn't in the correct components or features, and every renamed file must be manually moved in Organization.

Is it really required to scan the files and make new components on a simple /GetProperty command?

I suggest not doing the scan and update on commands that are "Gets" because it doesn't make any difference in that context.

Is there a way to tell AI to NOT perform the scan and update?

The only other choice is to set the 4-place version in an Ant property file for renaming purposes. But then it has to be maintained in more than one place.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: /GetProperty command causes file scan

Hello,

I'm afraid I don't fully understand your scenario. Can you please give us more details about this (maybe exemplify) or attach a sample which reproduces the behavior? Also, can you specify if you are using our synchronized folders support?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
thill
Posts: 111
Joined: Sat Jan 21, 2012 5:58 pm

Re: /GetProperty command causes file scan

Ok, because our product is rather complex I've taken a simple approach.

1. All the individual pieces are updated and built, e.g. Java/C++ compiles, etc.
2. A batch file is used to copy those pieces from many places into a staging directory.
3. An Ant script is used to get ProductVersion from the AI project file and used to rename some staged files and replace their references.
4. Then the AI installer is built.

The "Application Directory" is pointed to the root of the staging directory in our AI project.

We do not use any of AI's staging mechanisms, such as Synchronized Folders.

Where the problem lies is in step 3 AI is doing a refresh/scan of the Application Directory before those few files are renamed, etc. which messes-up components and features because new ones are added during the scan.

My questions are:
a. Is there a command-line option to tell AI to not refresh/scan the Application directory when getting the ProductVersion?
b. Is it possible to add an enhancement to not refresh/scan when using "getter" commands?

Thanks for your time.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: /GetProperty command causes file scan

Hello,

This may happens due to your approach steps order. Can you please try to use the following approach:
- build your Java/C++ source file in a temporary location
- get the ProductVersion property from AI and then rename the related files in the above temporary location
- add files from temporary location in your staging directory (and overwrite the existing ones) linked to "Application Folder"

and see if the behavior still persist?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
thill
Posts: 111
Joined: Sat Jan 21, 2012 5:58 pm

Re: /GetProperty command causes file scan

Daniel.Radu wrote:... and see if the behavior still persist?
Yes, you are correct. However the approach you suggest would change developers environments. And not all the files for AI would be assembled in the correct places. Our products come from many Subversion projects.

I know with certainty it is the act of accessing our AI project file for the GetProperty command that causes the content to be rescanned.

I am asking if there is an option to tell AI to not do that? But it would seem not. Have implemented a workaround for now.

So now it's an enhancement request. Add a command-line option to tell AI to not re-scan the directories of content. As an option if AI doesn't do what someone expects the use of that option is on them.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: /GetProperty command causes file scan

Hello,

I'm afraid this is the default behavior. Maybe we'll consider adding an improvement regarding this in a future version of Advanced Installer, but for the moment there are not immediate plans. Thank you for your understanding.

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

Return to “Building Installers”