How can I create image path with the propery value inside? - 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!

AlexN
Posts: 67
Joined: Mon Aug 20, 2012 2:05 pm

How can I create image path with the propery value inside?

In Themes/Images I can see the paths like
<AI_THEME>classic\resources\info.ico which expanded to actual install path.
How can I create such a path form custom image?
I want ot switch image dependent from Build.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How can I create image path with the propery value insid

Hello,

If you want to achieve a similar behavior, then you can try an approach like in our "Localizing images" thread. When use this approach please make sure that all controls which conditionally use the related images will have "Use Indirection" field, from "Properties" right pane, set to true. Also, when using custom actions to set the controls properties values with the related images properties values you should use a condition like this:
  • AI_BUILD_NAME = "Build_Name"
However, in order to achieve what you want you can proceed as follows (this is a little more complex solution):
- Create a directory structure like this for your images (i.e. if you have two builds):
  • WindowsVolume (i.e. C:\)
    Folder_1
    Folder_2
where Folder_1 will contain the first image (used for your first build) and Folder_2 will contain the second image (used for the second build). Also, both images should have the same name.
- Go to "Themes" -> "Images" tab and add first image from Folder_1 directory, using "New..." context menu option, like this:
  • Image Path: C:\Folder_1
    Property Name: MY_IMAGE
- Go to "Install Parameters" page and create a property, using "New" context menu option, like this:
  • Name: MY_PROP
    Value: Folder_1
    Build: FirstBuild
for FirstBuild and
  • Name: MY_PROP
    Build: SecondBuild
    Use specific value: Folder_2
for SecondBuild.

- Go to "Options" -> "Path Variables" and using [New...] button create a path variable, having "Private variable available only in this project" option enabled, like this:
  • Name: MY_PATH
    Value: C:\Folder_1
using "Select" -> "Folder on disk..." option in order to set the value field.

- From toolbar "Home" tab use [Convert Paths] button. In the "Path Variables Wizard" select only "Resource Files" check box and then your first image added from "Themes" -> "Images" tab.
- Save your project.
- Open the .aip (project file) using a text editor and edit the "AppPathsComponent" row to something like this:

Code: Select all

<ROW Name="MY_PATH" Path="..\..\..\..\..\..\[|MY_PROP]" Type="2" Content="0"/>
- Save the .aip file.
- Reopen and build and run your project.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AlexN
Posts: 67
Joined: Mon Aug 20, 2012 2:05 pm

Re: How can I create image path with the propery value insid

Thanks for the answer but this way is unassepted for such a tool.
- Open the .aip (project file) using a text editor and edit the "AppPathsComponent" row to something like this:
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How can I create image path with the propery value insid

We'll try to improve this in a future version. Thank you for your suggestion.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”