trashy
Posts: 14
Joined: Wed Jun 01, 2011 10:45 am

Path variables

I have used the "Path Variables Wizard" to convert existing project paths to use path variables. I would now like to use the command line to set my path variable (in this case <WindowsVolume>) prior to starting a build.

I assume that I need to use something like this:

[<path>\]AdvancedInstaller.com /loadpathvars <path_variables_file_path>

Followed by:

[<path>\]AdvancedInstaller.com /rebuild [project_file_path] <- this works fine as it currently uses the default values of C: for <WindowsVolume>

However:

1) What is the file format of the file referenced by path_variables_file_path?
2) Am I on the right track?!
trashy
Posts: 14
Joined: Wed Jun 01, 2011 10:45 am

Re: Path variables

BTW, I've tried the following as suggested by a previous post, but Convert Paths still uses <WindowsVolume> instead of my new variable.

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.
octavian.vasilovici
Posts: 51
Joined: Tue Jan 25, 2011 2:43 pm

Re: Path variables

Hello and welcome to Advanced Installer forums,
What is the file format of the file referenced by path_variables_file_path?
In order to obtain a file that will contain custom path variables the following steps must be taken:

1. Using Advanced Installer GUI go to "Options -> Path Variables".
2. In the Path Variables Editor declare your custom path variable.
3. Press "OK" button. This is important!!
4. Open again the Path Variables Editor and select "Operations-> Save To..." option and save your file to a location where you have writing permissions. Ex: D:\ (otherwise the file might not be created)

Once you have obtained the XML file you can use it with "/loadpathvars" cli option. For future use it is highly recommended not to manually edit the XML file but make the necessary changes using Advanced Installer GUI and export the file again.
BTW, I've tried the following as suggested by a previous post, but Convert Paths still uses <WindowsVolume> instead of my new variable.
I also tested the "Convert Path" wizard and I could not reproduce the behaviour you encountered. Are you using Advanced Installer 8.1.3?

The steps I followed in order to to successfully use "Convert Paths" wizard are:

1. Go to "Files & Folders" page and add your files. (Ex: C:\Foo\Foo.txt)
2. Go to "Options -> Path Variables" and add a new path variable. (Ex: Name: DIR_PATH ; Value: C:\Foo)
3. Go to "Project -> Convert Path" and run the wizard. (In the Summary Dialog you will see: Original Path: C:\Foo\Foo.txt -> Converted Path: <DIR_PATH>foo.txt)

If you have any other question, please don't hesitate to contact us.

Best Regards,
Octavian
_______________________________________________________________________________________________________________________________________________
Octavian Vasilovici
Advanced Installer Team
http://www.advancedinstaller.com/
Octavian Vasilovici - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
trashy
Posts: 14
Joined: Wed Jun 01, 2011 10:45 am

Re: Path variables

octavian.vasilovici wrote:I also tested the "Convert Path" wizard and I could not reproduce the behaviour you encountered. Are you using Advanced Installer 8.1.3?

The steps I followed in order to to successfully use "Convert Paths" wizard are:

1. Go to "Files & Folders" page and add your files. (Ex: C:\Foo\Foo.txt)
2. Go to "Options -> Path Variables" and add a new path variable. (Ex: Name: DIR_PATH ; Value: C:\Foo)
3. Go to "Project -> Convert Path" and run the wizard. (In the Summary Dialog you will see: Original Path: C:\Foo\Foo.txt -> Converted Path: <DIR_PATH>foo.txt)
Thanks - I've done as above, but instead of using my new path variable the wizard uses <WindowsVolume>. I have tried removing and re-adding all of the files in "Files & Folders'. I have also tried the "Automatically convert using existing path variables" option in Edit Project Settings. Is there any way of specifying the order in which path variables should be used?

BTW, my current path variable is EVOLVI with a value of C:\projects\TravelPackOnline\VS2008\EvolviPrint\bin.
octavian.vasilovici
Posts: 51
Joined: Tue Jan 25, 2011 2:43 pm

Re: Path variables

Hello,
Is there any way of specifying the order in which path variables should be used?
There isn't any order regarding path variables. A path from a file is substituted with a path variable based on the best match.

I have made a test using Advanced Installer 8.1.3 with the folders you are using (C:\projects\TravelPackOnline\VS2008\EvolviPrint\bin) and using the EVOLVI path variable. Unfortunately, I wasn't able to reproduce this behaviour.

Can you please, try to move your files to another partition and redo the operation in a new clean project and tell us what the outcome is?

Best Regards,
Octavian
_______________________________________________________________________________________________________________________________________________
Octavian Vasilovici
Advanced Installer Team
http://www.advancedinstaller.com/
Octavian Vasilovici - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
trashy
Posts: 14
Joined: Wed Jun 01, 2011 10:45 am

Re: Path variables

octavian.vasilovici wrote: Can you please, try to move your files to another partition and redo the operation in a new clean project and tell us what the outcome is?
It didn't work at first, but if I closed down Advanced Installer after making a change to the Path Variables but before running the Convert Paths Wizard then everything is ok. Looks like the closing (or saving) process is required for AI to see the changes.

Many thanks.
kgreen2017
Posts: 1
Joined: Wed May 17, 2017 7:41 pm

Re: Path variables

trashy wrote:
octavian.vasilovici wrote: Can you please, try to move your files to another partition and redo the operation in a new clean project and tell us what the outcome is?
It didn't work at first, but if I closed down Advanced Installer after making a change to the Path Variables but before running the Convert Paths Wizard then everything is ok. Looks like the closing (or saving) process is required for AI to see the changes.

Many thanks.
Note, I can confirm that with Advanced Installer 14.0.2 it is still necessary to exit and relaunch Advanced Installer after creating a Path Variable in order for the "Convert Paths" Wizard to pick it up. Just ran into this. Thank you for the explanation trashy.

Additionally if you've exited and re-launched Advanced Installer and your path variables still don't seem to be working, you may need to run the Convert Paths Wizard again to make your paths absolute, then run the Convert Paths Wizard again.

To do this: run the Convert Paths Wizard, uncheck the top level of your drive for each type of file. You will end up with fully absolute paths. This will remove the "<WindowsVolume>" entries from your project's paths. Then re-run the Convert Paths wizard, this time making sure the top level of your drive is selected for each type of file. At this point it should convert your paths as you expect.
Eusebiu
Posts: 4934
Joined: Wed Nov 14, 2012 2:04 pm

Re: Path variables

Hi and welcome to Advanced Installer forums.

In my tests the conversion worked without being necessary to re-launch Advanced Installer, but maybe I did not understand the scenario very well.

Nevertheless, thank you for sharing your solution with us, it may help other users in the future.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”