Properties variable in filenames - 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!

neFAST
Posts: 13
Joined: Mon Jun 30, 2008 2:30 pm

Properties variable in filenames

I have a folder contaning plugins with a naming scheme including the build version:
  • TEST-plugin_debug_2_1_507.dll
    EXAMPLE-plugin_debug_2_1_507.dll
    ...
and I'd like to avoid to edit my *.aip with "search and replace" each time I change my build number.
Is there any way to define a [build] variable and reuse it in the source path of my files?

Thanks a lot.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Properties variable in filenames

Hi,

This can be done by using a pseudo-formatted property (a property which is resolved when the package is built). Here are the steps:
- go to the Install Parameters page and create a property
- set it's value to the build version
- go to the Files and Folders page
- right-click one of the files which has a custom name based on the build version
- select the "Properties" context menu
- in the Properties tab of the "Edit File" dialog set the "Name" field to something like this:

Code: Select all

TEST-plugin_debug_[|BUILD].dll
-where "[|BUILD]" is the custom property which contains the build version
- do the same for the other files which contain the build version

When the package is built the property in the name of the files will be resolved to its default value.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
neFAST
Posts: 13
Joined: Mon Jun 30, 2008 2:30 pm

Re: Properties variable in filenames

Ok,
this will resolve the name, but not the source?

Other question: is it possible to include a windows user variable in the path of a file? I'd like aip to find the QT dir automatically.
Last edited by neFAST on Mon Jun 30, 2008 5:04 pm, edited 1 time in total.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Properties variable in filenames

Hi,

I'm not sure I understand what you mean. Can you please give me more details about this?
Note that this approach changes only the names of the files in the resulted MSI. It will not affect the files on the disk or the paths of the files in your project.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
neFAST
Posts: 13
Joined: Mon Jun 30, 2008 2:30 pm

Re: Properties variable in filenames

That's it. When I compile my program, the dll have a build number in it.
So I would like to change the path of the files of my project.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Properties variable in filenames

Hi,

This can be done by using the synchronization feature. You can configure this feature by using the Synchronize tab of the "Edit Folder" dialog.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
neFAST
Posts: 13
Joined: Mon Jun 30, 2008 2:30 pm

Re: Properties variable in filenames

Thanks for your help.
But can I combine sync with variables in filters ?

I have a plugin folder where I can find all my recently compiled dll
  • pluginA-405.dll
    pluginA-406.dll
    pluginA-407.dll
    pluginB-407.dll
    pluginA-debug-405.dll
    pluginA-debug-406.dll
    pluginA-debug-407.dll
I want to sync all the plugin*-407.dll. I can exlude "*debug*" to remove debug version, but how can I select only the [BUILD]=407 version?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Properties variable in filenames

Hi,
But can I combine sync with variables in filters ?
I'm afraid that this is not supported by Advanced Installer. When you define the synchronization filters you can use only hard-coded values.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
neFAST
Posts: 13
Joined: Mon Jun 30, 2008 2:30 pm

Re: Properties variable in filenames

So, do you think there's another way to achieve this particular selection?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Properties variable in filenames

Hi,

I'm not sure why the hard-coded value doesn't suit your needs. If you synchronize only one folder based on the build version, when you create a new version of the files you will change only one filter (the equivalent of changing a property which contains the build version).

However, a good solution would be to mange the files from outside. Basically, you can have a folder which contains only the latest files of your application (it doesn't contain older build versions). This folder can be synchronized with a folder in your package.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”