joefio
Posts: 23
Joined: Thu Apr 20, 2023 2:14 pm

Change physical source to relative path

Hi I am trying to figure out how I can change the path of my Files and Folders to be relative instead of hardcoded. These are my project options:
projectOptions.PNG
projectOptions.PNG (27.76 KiB) Viewed 17890 times
The root path is: C:\QDV\Branches\QDV-1332\Install\QdvClient\MSI\

I read on another forum that even though my Files and Folders appear as absolute in the "Files and Folders" screen, they are actually relative internally. From what I understand, the paths are supposed to be relative to the project root path. However I'm not exactly sure what it means to be "relative to the root path".

If I copy my project file from one project branch to another, it can no longer find the files. The physical source is still pointing to the old branch instead of the new one. For example my project file was located: C:\QDV\Branches\QDV-1332\Install\QdvClient\MSI\MyProject.aip and I moved it to C:\QDV\Branches\QDV-1333\Install\QdvClient\MSI\MyProject.aip. However the physical source of my files is still pointing to C:\QDV\Branches\QDV-1332\Install\QdvClient instead of C:\QDV\Branches\QDV-1333\Install\QdvClient.

How can I modify this so that I can move the project file to a different branch and still have it find the files?

Thank you,
Joe F
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Change physical source to relative path

Hello Joe,

Not entirely sure I fully understand your scenario here, but wouldn't it be better to have the files as absolute in your case?

As per the documentation:
Having an absolute path for each file allows you to move the project file (.AIP) anywhere on your disk (even on different partitions). The application will still be able to find all the files. But the project file cannot be moved to a different computer, unless you have the files in the exact location (and drive) as on the original computer.
Isn't this what you'd need here?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
joefio
Posts: 23
Joined: Thu Apr 20, 2023 2:14 pm

Re: Change physical source to relative path

Catalin wrote: Mon Jun 19, 2023 12:15 pm Hello Joe,

Not entirely sure I fully understand your scenario here, but wouldn't it be better to have the files as absolute in your case?

As per the documentation:
Having an absolute path for each file allows you to move the project file (.AIP) anywhere on your disk (even on different partitions). The application will still be able to find all the files. But the project file cannot be moved to a different computer, unless you have the files in the exact location (and drive) as on the original computer.
Isn't this what you'd need here?

Best regards,
Catalin
The problem is that if I move the project file from C:\QDV\Branches\QDV-1332\Install\QdvClient\MSI\ to C:\QDV\Branches\QDV-1333\Install\QdvClient\MSI\ all of my files in the project are still pointing to a location in C:\QDV\Branches\QDV-1332 when it should now be pointing to C:\QDV\Branches\QDV-1333.

For example:
I open my project file located in C:\QDV\Branches\QDV-1332\Install\QdvClient\MSI\
In Files and Folders I have a file program.exe
The source path is of program.exe is C:\QDV\Branches\QDV-1332\Install\QdvClient\Client
I open the same project file in C:\QDV\Branches\QDV-1333\Install\QdvClient\MSI\
The source path of program.exe is still C:\QDV\Branches\QDV-1332\Install\QdvClient\Client
The source path of program.exe should be C:\QDV\Branches\QDV-1333\Install\QdvClient\Client

Ultimately the project file will be uploaded to a repository. When other developers check out the project, it gets saved to a directory with an incremented branch id#(i.e. QDV-1332). I am trying to figure out how I can automate the project file to change the source path of my files based on the branch/directory that the project file is being run out of.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Change physical source to relative path

Hello Joe,

Thank you for your followup on this!

From what I can see, you include the number which eventually changes into the root path - QDV-1332

If possible, could you please try to set the root path to the "Branches" folder instead and let me know if that helps?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
joefio
Posts: 23
Joined: Thu Apr 20, 2023 2:14 pm

Re: Change physical source to relative path

Catalin wrote: Thu Jun 22, 2023 1:13 pm Hello Joe,

Thank you for your followup on this!

From what I can see, you include the number which eventually changes into the root path - QDV-1332

If possible, could you please try to set the root path to the "Branches" folder instead and let me know if that helps?

Best regards,
Catalin
Hi Catalin,

I set my project options up like below:
projectOptions.PNG
projectOptions.PNG (18.11 KiB) Viewed 15412 times
I copied the project to C:\QDV\Branches\QDV-1333\Install\QdvClient\MSI\

However none of my files updated to the new path they all still point to a location in C:\QDV\Branches\QDV-1332

Joe F
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Change physical source to relative path

Hello Joe,

This is really strange, indeed.

If possible, could you please forward me a copy of your AIP file by email at support at advancedinstaller dot com so I can further test this?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Change physical source to relative path

Hello Joe,

Thank you for providing the AIP file.

I have had a look over it and I believe what we should be looking for here is a Path Variable that we can easily change after each of your builds.

In "Files and Folders" page, right click on a file (e.g. Advset32.exe) --> "Convert To" --> "New path variable" and create a path variable.

After doing so, on the same page go to "Wizards" (on the ribbon) --> "Convert paths".

Screenshot_30.png
Screenshot_30.png (38.18 KiB) Viewed 14733 times
Screenshot_31.png
Screenshot_31.png (53.95 KiB) Viewed 14733 times

The paths from C:\QDV-1332\Install\QdvClient\Client should be converted as per the above screenshot.

Additionally, we should also se the following option:
image (5).png
image (5).png (12.77 KiB) Viewed 14732 times
from the "Project" (in the ribbon) --> "Options".

When changing to the new version, we can just modify the value of the path variable and all the files should be referenced correctly in the project now.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
joefio
Posts: 23
Joined: Thu Apr 20, 2023 2:14 pm

Re: Change physical source to relative path

Catalin wrote: Fri Jul 07, 2023 11:22 am Hello Joe,

Thank you for providing the AIP file.

I have had a look over it and I believe what we should be looking for here is a Path Variable that we can easily change after each of your builds.

In "Files and Folders" page, right click on a file (e.g. Advset32.exe) --> "Convert To" --> "New path variable" and create a path variable.

After doing so, on the same page go to "Wizards" (on the ribbon) --> "Convert paths".


Screenshot_30.png


Screenshot_31.png


The paths from C:\QDV-1332\Install\QdvClient\Client should be converted as per the above screenshot.

Additionally, we should also se the following option:

image (5).png

from the "Project" (in the ribbon) --> "Options".

When changing to the new version, we can just modify the value of the path variable and all the files should be referenced correctly in the project now.

Hope this helps!

Best regards,
Catalin
Hi Catalin,

I converted all my paths to have a project path variable and it works great. Our build process is kicked off by a batch file which calls a series of scripts to automate the build. I have added a powershell script that updates the project path variable with the appropriate directory. This is exactly what I needed.

Thanks for your help

Joe F
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Change physical source to relative path

You are always welcome, Joe!

Glad I was able to assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”