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

Having trouble running Advanced Installer? Got a bug to report? Post it all here.

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

Postby AlexN » Thu Aug 23, 2012 8:18 am

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.
AlexN
 
Posts: 67
Joined: Mon Aug 20, 2012 2:05 pm

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

Postby Daniel » Thu Aug 23, 2012 3:53 pm

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
http://www.advancedinstaller.com/
Daniel
 
Posts: 2006
Joined: Mon Apr 02, 2012 1:11 pm

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

Postby AlexN » Fri Aug 24, 2012 8:22 am

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:
AlexN
 
Posts: 67
Joined: Mon Aug 20, 2012 2:05 pm

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

Postby mihai.petcu » Fri Aug 24, 2012 12:53 pm

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

All the best,
Mihai
Mihai Petcu
Advanced Installer Team
http://www.advancedinstaller.com/
mihai.petcu
 
Posts: 3452
Joined: Thu Aug 05, 2010 8:01 am


Return to Common Problems

Who is online

Users browsing this forum: Google [Bot] and 3 guests