Properties and Command Line - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

tpro
Posts: 5
Joined: Thu May 19, 2011 5:27 pm

Properties and Command Line

We currently have built a pretty extensive system using Wise Installer. Long story short, we purchased AI Professional for a project that needed an MSI and needed to install a service and I'm looking into recreating our Wise system with AI.

Basically, our process starts when a group of variables from a web page are read into a script that spawns a package generation. That script then stamps the package with a version, uses different paths based on the version, and modifies shortcuts to include things such as server IP, ports, etc. With Wise we set up variables that are received on the command line when the script launches the package build building a custom tailored package for the end user who is then notified via e-mail it is ready for download on our secure site.

It looks like in AI, these variables would be referred to as "Properties" under Install Parameters and I'm able to reference them in the shortcut Arguments field and some other places, including referencing them in other properties which is all fine and good. But I do hit a snag in a couple places.

The first one is the Product Version on the Product Details page, but this might not be a big deal as it looks like I can supply that via command line.

The second place which is a very big deal is under Files and Folders when selecting the source. Based on the version used in the build, I source the files from different folder. For example, the source path may be something like C:\Release\Gold\ver0.0.0, which would be a combination of two variables (properties); one for the first part of the file source path ("C:\Release\Gold\ver"), and the other being the version("0.0.0").

Is there no way possible to use the properties or some other variable means within the file's Source field?

In addition, it appears that in order to pass in these Properties via command line, I actually need to use the Editing commands in the form of "/SetProperty". Over all, I would need to Load the project, Modify using the /SetProperty, Save it, then I could build it? Or, is there a way to pass these in on a single command to just build the project without modifying the .aip file?

Thanks!
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Properties and Command Line

Hello and welcome to the Advanced Installer Forums,
Is there no way possible to use the properties or some other variable means within the file's Source field?
You can have a look at our synchronized folder feature which is explained in this article. This can also be set from the command line as described in here.
Or, is there a way to pass these in on a single command to just build the project without modifying the .aip file?
There is no need to open the .AIP GUI if you are working from the command line. You can both modify the property and build the project from the same command line. The "Set Property" command can be used as described in its user guide reference from this link. Also here is the complete user guide web page to all possible command lines and their usage. You can test any of these command with your current project from the "cmd.exe" shell.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tpro
Posts: 5
Joined: Thu May 19, 2011 5:27 pm

Re: Properties and Command Line

Thanks for the reply. I'll have to digest all this and put it into play. So far I am really liking the product. I've been a Wise user for over 10 years (not their MSI stuff, just the old EXE packager) so this old dog is just needing to change my way of thinking for new tricks :wink:
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Properties and Command Line

You are welcome, if you find any difficulties we'll be glad to assist.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tpro
Posts: 5
Joined: Thu May 19, 2011 5:27 pm

Re: Properties and Command Line

Actually, things still weren't still in the manner that I had built a system around. But, since the .aip files are text, I'm going to keep my "reference file", copy it off to the custom file when a build is requested (what I do with Wise anyway), then within the Perl script that handles all this already I'll use regular expressions to replace the versions, path, and some other items that I need flexibility with. I'll then fire up the build with this custom file. Then when I send the notification to the customer that requested the package I'll now include links for both EXE and MSI packages and let them choose. To them, no additional steps to existing process and those requesting that we offer an MSI will be happy.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Properties and Command Line

Hello,

Please note that manually editing the .AIP using a text editor can lead to unexpected behavior and untraceable future miss-functionality, thus it is not recommended. If you only need to modify simple things, I suggest you do so using the Advanced Installer CLI. If you're still willing to take the risk you will need to save the modified .AIP using UTF-8 encoding.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tpro
Posts: 5
Joined: Thu May 19, 2011 5:27 pm

Re: Properties and Command Line

Is there any reason that file paths can't be fully variablized? I did discover that an icon used for a shortcut was correctly using a variable in the .aip file ("<PICKUP>oasisnew.ico", with <PICKUP> being the full path to the source files) although of course I can't turn around and edit the entry as it results in an open file dialog. Out of all the files in the project that were converted to the path variables, oddly enough the icon was the only one converted to the variable equivalent that matched the full path. When opening the file dialog from this, it doesn't try and resolve the <PICKUP> path variable either.

Seems like the entry for file paths could be changed from a read-only text box that receives the return from the open file dialog to a free entry text box allowing the entry of the path variable. Then when the value is used, all variables could be resolved at run-time when being used in the path.

If this was allowed, the folder variable could be then be set via command line and a different source could be used to pickup files from (and of course, I'd not have to worry about changing the source path in the .aip file making me a very happy camper :D)
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Properties and Command Line

Hi,
eems like the entry for file paths could be changed from a read-only text box that receives the return from the open file dialog to a free entry text box
allowing the entry of the path variable. Then when the value is used, all variables could be resolved at run-time when being used in the path.
If this was allowed, the folder variable could be then be set via command line and a different source could be used to pickup files from
I'm not sure I understand exactly what you are trying to achieve, but here is the solution I propose. First you can go to "Options -> Path Variables..." in
Advanced Installer GUI and create a new variable that points to a location of some of your files. Then go to Files and Folders page and add a file from that location.
After this run the conversion paths wizard from "Project -> Convert Paths..." so the variable you've just defined is used instead of the direct path of the file. Save the aip file.

Now you can try edit the aip file from CLI (AdvancedInstaller.com utility), using the commands that allow you to delete and add a new environment variable. Delete the variable you created in the beginning and then create a new one with the same name, but which points to another location, from which a file with same name is picked, but with different content.

This should perform the actions desired if I understood correctly your requirements, if no please give me more details on what have I misunderstood.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tpro
Posts: 5
Joined: Thu May 19, 2011 5:27 pm

Re: Properties and Command Line

Bogdan wrote: I'm not sure I understand exactly what you are trying to achieve, but here is the solution I propose. First you can go to "Options -> Path Variables..." in
Advanced Installer GUI and create a new variable that points to a location of some of your files. Then go to Files and Folders page and add a file from that location.
After this run the conversion paths wizard from "Project -> Convert Paths..." so the variable you've just defined is used instead of the direct path of the file. Save the aip file.
I had previously tried that thinking that would be the solution, but when it resolves path, the only correctly resolved items were the icons. For example, I have a path such as "C:\Foo\Release\Ver0.0.0" that should be the variable "PICKUP". When I do the convert paths wizard, all of the files, etc., turn into "<WindowsVolume>Foo\Release\Ver0.0.0". Only the icons correctly resolve as "<PICKUP>MyIcon.ico"

Of course, I can not edit the fields to be "<PICKUP>filename.ext" in the AIP GUI as it only allows the file selection dialog (one of the things I'd mentioned previously in the thread.)

Thanks,
Tim
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Properties and Command Line

Hi Tim,
For example, I have a path such as "C:\Foo\Release\Ver0.0.0" that should be the variable "PICKUP". When I do the convert paths wizard, all of the files, etc., turn into "<WindowsVolume>Foo\Release\Ver0.0.0". Only the icons correctly resolve as "<PICKUP>MyIcon.ico"
This is exactly what I did in my test, before I wrote the above post, and the path was correctly replaced. Can you try this again with a new path? Maybe there was a mistake in the steps you have performed previously.
Also, I am using the latest version, i.e. 8.1.3, I assume this is the one you are using too?

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”