antoinea
Posts: 4
Joined: Fri Jun 14, 2019 4:49 pm

Files and folders contains invalid paths

Hello, i created an Advanced Installer project by importing a project from Visual Studio. All works well, but the paths of Files and Folders look like a mess. I have a bunch of files imported from C:\Users\<my user>\.nuget\packages. Others are from C:\Program Files\dotnet\sdk\NuGetFallbackFolder

Those files (and especially the ones in the user folder) are not found if I try to build on another machine. How should i setup things properly so that all is portable to other machines?

Thanks,
Antoine
antoinea
Posts: 4
Joined: Fri Jun 14, 2019 4:49 pm

Re: Files and folders contains invalid paths

Any help?
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Files and folders contains invalid paths

Hello Antoinea and welcome to Advanced Installer forums,

First of all, please accept my apologies for the delayed reply.

Paths are stored (in AIP) by default as relative to the project file (AIP), if they reside on the same logical drive as the AIP.
Otherwise, they are stored in absolute form.

Check available options here:
http://www.advancedinstaller.com/user-g ... s-tab.html

Also, be aware, that if you use project app paths (symbolic variable paths), they may be subject to environment changes (dependent on the machine where you open the project) - this being the intended behavior.


http://www.advancedinstaller.com/user-g ... ables.html
http://www.advancedinstaller.com/user-g ... h-var.html

Project resource files policy:
http://www.advancedinstaller.com/user-g ... ables.html

Here is a piece of advice for you: If there is a parent folder for all your files from the "Files and Folders" page, try to save the .AIP file in that parent folder and, upon moving the .AIP file to a new PC, move it together with all the file that are necessary to build the project.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
antoinea
Posts: 4
Joined: Fri Jun 14, 2019 4:49 pm

Re: Files and folders contains invalid paths

Hi Catalin, unfortunately this doesn't help for files that are pulled from paths like
C:\Users\<my user>\.nuget\packages.

the <my user> part will of course not exist on any other machine, whether the path is absolute or relative. It seems like this may be specific to Nuget packages detected by your Visual Studio solution importer. How can this be fixed?
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Files and folders contains invalid paths

Hello Antoinea,

Indeed, you are right. That might not work for paths such as the one you mentioned.

However, in this case, the path variables may come in handy. Path variables are used to specify locations on the file system.

For better understanding, let's work with an example.

On a VM, I have created an Advanced Installer project, containing only one .txt file in the "Files and Folders" page ("Application Folder"). This file is linked from the following location:

"C:\Users\Catalin\Desktop\ccc\asd.txt"

Let's say that we want to create a path variable for this file. In order to create a path variable, you can go to "File" --> "Settings" --> "Path Variable".
Capture.PNG
Capture.PNG (14.82 KiB) Viewed 6266 times
In the "Edit Path Variables" dialog, press on the "New..." button. The path variable I have created is the following:

Name: zzz
Value: C:\Users\Catalin\Desktop\ccc


Click "Ok".

Now we have to convert the paths from our project in order to support path variables. To do so, click on the "Wizards" tab from the toolbar and then click on the "Convert Paths" button.
Capture1.PNG
Capture1.PNG (25.3 KiB) Viewed 6266 times
After doing so, a Wizard will be spawned, allowing you to convert existing project paths to use path variables.

"Next" --> "Files" --> here Advanced Installer automatically detects which files use the path variable --> "Next" --> "Next" --> "Finish"

Save the project (ctrl+s).

Now, upon moving the project from the VM to my machine, here is how the path to the .txt file looks like:
Capture2.PNG
Capture2.PNG (10.05 KiB) Viewed 6266 times
As you can notice, the project does not recognize the path variable. This means that we need to create it. Now, of course, this all depends on where the file (in our case, the .txt file) is on my machine. For instance, I have moved the .txt file to:

"D:\zzz\asd.txt"

Now, in order to create the path variable for the new machine, all we have to do is to go to "File" --> "Settings" --> "Path Variables". There, we should create the new path variable for our machine (it should have the same name as the one created earlier. As you can see, it is referenced by name. However, the path does not have to be the same). Here is how the path variable could look in our case:

Name: zzz
Value: "Select" --> "Folder on disk..." --> now we should select our folder (D:\zzz)


Now, if you go to "Files and Folders" page, the files will automatically be referenced to your path.

Hope this helps.

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

Return to “Common Problems”