# FinalBuilder and relative paths (parent folders ..\\..\\help\\please\\)

**URL:** https://www.finalbuilder.com/forums/t/finalbuilder-and-relative-paths-parent-folders-help-please/2122
**Category:** Discussion
**Created:** [April 18, 2013, 8:26am UTC](https://www.finalbuilder.com/forums/t/finalbuilder-and-relative-paths-parent-folders-help-please/2122 "2013-04-18T08:26:59Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Jenasys](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jenasys/32/888_2.png) [@Jenasys](https://www.finalbuilder.com/forums/u/Jenasys)
#### Post date: [April 18, 2013, 8:26am UTC](https://www.finalbuilder.com/forums/t/finalbuilder-and-relative-paths-parent-folders-help-please/2122/1 "2013-04-18T08:26:59Z")

</div>

G'day,

I'm trying to work with relative folder paths within FinalBuilder project and Continua. For example I have a project that I want to execute from Continua or if the users don't have continua, can execute from FinalBuilder. Here is the structure of the Repository that contains the final builder project.

### Source Code Repository Structure

\src\Sample1\*.sln

\src\Sample2\*.sln

\db\*.sql

\buildrunners\*.fbp7

&nbsp;

If I want to build all the Visual Studio \*.sln&nbsp;within the repository from final builder I can use the FileIterator and a "..\..src\*.sln" search and if finds all the solutions. However I can't pass that value into the Visual Studio Action as it will assume it's relative to the devenv.com.

So I get compile errors like

```
Solution ..\..\Samples\Android\cs\SimpleApp\SimpleApp.slnRunning C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.com with parameters : /build "Debug|Any CPU" "..\..\Samples\Android\cs\SimpleApp\SimpleApp.sln"
```

```
 
```

How can I convert relative path "parents" to actual folders, so these final builder 7 projects can be run anywhere a person downloads the repository file on a PC?

Attachment unavailable

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [April 18, 2013, 9:08am UTC](https://www.finalbuilder.com/forums/t/finalbuilder-and-relative-paths-parent-folders-help-please/2122/2 "2013-04-18T09:08:03Z")

</div>

FinalBuilder does not support relative paths, you must anchor all paths to a folder.   
  
 [https://www.finalbuilder.com/Support/Forums/aft/10321.aspx](https://www.finalbuilder.com/Support/Forums/aft/10321.aspx)   
  
 So my recommendation here create a FinalBuilder Project variable : ROOTPATH - set it’s default value to a path that will work when FB is run stand alone, e.g %FBPROJECTDIR%   
  
 In continua, on the FinalBuilder Action, set ROOTPATH=$WORKSPACE$

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [April 18, 2013, 9:09am UTC](https://www.finalbuilder.com/forums/t/finalbuilder-and-relative-paths-parent-folders-help-please/2122/3 "2013-04-18T09:09:53Z")

</div>

Forgot to mention, for your fileset, you would then just use %ROOTPATH%\path\to\samples

---

<div class="post-metadata">

### Author: ![Jenasys](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jenasys/32/888_2.png) [@Jenasys](https://www.finalbuilder.com/forums/u/Jenasys)
#### Post date: [April 18, 2013, 2:34am UTC](https://www.finalbuilder.com/forums/t/finalbuilder-and-relative-paths-parent-folders-help-please/2122/4 "2013-04-18T02:34:39Z")

</div>

> Posted By [Vincent Parrett](https://www.finalbuilder.com/User-Profile/userid/5.aspx) on 18 Apr 2013 02:08 AM  
> FinalBuilder does not support relative paths, you must anchor all paths to a folder.&nbsp;&nbsp;

  

Vincent, I accept that FB should use full paths for all the various actions. It&nbsp;definitely the safe approach. However, this is one of the things that nagged my about finalbuilder projects and a believe a significant functional UX improvement for your excellent software.

In IMHO there seems to be a few options to resolve the relative paths, by simply calling API's which do support that logic. Hence Actions like file iterators could resolve relative paths to anchored paths.&nbsp; When I think back to how I was doing things in FB Server 7 days, I often had to setup my build server with the exact same folder structure as final builder for projects to execute consistently (or use project variables, as your post suggests).

API's that support relative paths:-

**Powershell** - Resolve-Path&nbsp;&nbsp;[http://technet.microsoft.com/en-us/...49858.aspx](http://technet.microsoft.com/en-us/library/hh849858.aspx)

E.g. Resolve-Path -Path C:\Users\Jamie\Documents\GitHub\csla\Support\BuildRunners\..\..\Samples resolves correctly.

**.net - C#**

public static string ResolveRelativePath(string referencePath, string relativePath)   
{   
&nbsp;&nbsp;&nbsp; return Path.GetFullPath(Path.Combine(referencePath, relativePath));  
}

Basically what I'm trying to point out, is FinalBuilder&nbsp;would benefit from&nbsp;a new action (or modify some of the existing actions) to call windows API's that support relative paths. Vsoft customers could then use FinalBuilder or Continua&nbsp;+ FinalBuilder software and execute&nbsp;projects without having to manually change variables or pass root paths in/out of the project from Continua. This seems to be even more critical,&nbsp;&nbsp;when FinalBuilder projects are included in repositories.

Does that make sense to you guys?

---

<div class="post-metadata">

### Author: ![Jenasys](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jenasys/32/888_2.png) [@Jenasys](https://www.finalbuilder.com/forums/u/Jenasys)
#### Post date: [April 18, 2013, 2:43am UTC](https://www.finalbuilder.com/forums/t/finalbuilder-and-relative-paths-parent-folders-help-please/2122/5 "2013-04-18T02:43:40Z")

</div>

Of course your file iterator, does seem to support relative paths. This worked for me (undocumented feature)! Very Happy.

Attachment unavailable

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [April 19, 2013, 1:47am UTC](https://www.finalbuilder.com/forums/t/finalbuilder-and-relative-paths-parent-folders-help-please/2122/6 "2013-04-19T01:47:00Z")

</div>

Hi Jamie   
  
 The difficulty is that microsoft does not document which win32 api functions support relative paths (FinalBuilder is an unmanaged application) and most that we use do not. If you leave it to the api to resolve the relative path, it will do that to the current directory for the application, which is not very useful in a multithreaded application and probably not what you intended anyway.   
  
 The problem is that in different actions, users will have different expectations of how relative paths should work. For example, on the [VS.NET](http://VS.NET) action, if I set the OutputPath property to a relative path, is that relative to the solution, the finalbuilder project or the current directory? If I set the Solution property to a relative path, what is that relative to?? The potential for confusion (and thus support load) there is immense.   
  
 We have looked at adding relative path support many times over the years and have yet to come up with a satisfactory, consistent and obvious (to the user) solution. FWIWI, most windows api’s do support anchored relative paths, which is why your fileset example above works.
