Announcement

Collapse
No announcement yet.

How to specify relative paths for archive files?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to specify relative paths for archive files?

    I have multiple machines (dev vs automated build machine) where installers run with source code in different locations on each machine.

    I would like to specify my included (Archive) files using relative paths to the installer config location.

    For example, given the following file tree:

    Dev Machine with installer config here: C:\Source\installation\MyInstaller.suf
    Code:
    C:\Source\Release\MyApp.exe
    C:\Source\Release\MyDll.dll
    C:\Source\resources\MyIcon.ico
    and on the build machine with the installer config here: D:\Release1234\installation\MyInstaller.suf

    Code:
    D:\Release1234\Release\MyApp.exe
    D:\Release1234\Release\MyDll.dll
    D:\Release1234\resources\MyIcon.ico
    In MyInstaller.suf, I'd like to reference MyApp.exe, MyDll.dll, and MyIcon.ico as relative paths so that the same .suf file works on both machines (or if I decide I want my source code on my dev machine to be in D:\Source2 sometime later I don't have to update my installer script.
    Code:
    ..\Release\MyApp.exe
    ..\Release\MyDll.dll
    ..\resources\MyIcon.ico
    Are relative paths possible? I've tried simply changing the directory but the files report as missing in the IDE. I also tried just running the build anyway and of course it failed. Is the path relative to something else? Or possibly configurable? Or how do I work around this issue?

  • #2
    You can build relative paths using the design-time constant #PROJECTFILEDIR#. In other words, your paths could be written as
    Code:
    #PROJECTFILEDIR#\..\Release\MyApp.exe
    #PROJECTFILEDIR#\..\Release\MyDll.dll
    #PROJECTFILEDIR#\..\resources\MyIcon.ico
    Ulrich

    Comment

    Working...
    X