Loading
Path Variables in Path Variables
In my MSI project, I'd prefer to construct my path variables as follows:

 

PATH_ROOT.....C:\

 

PATH_A...........\FilesA\

 

PATH_B...........\FilesB\

 

I.e., I try to create one 'root' path variable and then use that variable in other path variables so if the root path changes, I only have to change it in one spot. What I was hoping to do was override the PATH_ROOT variable via a command line call to IsCmdBld.exe, using the -l parameter (path override parameter).

 

However, when I do this, the paths that contain don't seem to get updated; they still point to whatever the default PATH_ROOT was, in this case C:\.

 

Am I trying to accomplish something that can't be done? Do I have to override all the path variables instead of just PATH_ROOT? (Overriding all the parameters seems to work, but then there's no point in me trying to be efficient and use the PATH_ROOT variable :( )

  • You don't say what you're doing with these paths, so I'm going to think of them as being used to construct pickup paths for your components. Here's what I'm thinking:

     

    Component1's pickup path: \FilesA

     

    Component2's pickup path: \FilesB

     

    or if you'd like the path to FilesA and FilesB to be dynamic, also set them at build time:

     

    Path Variables:

     

    PATH_ROOT = C:

     

    FilesA = parentfolder1\subfolder1

     

    FilesB = parentfolder2\subfolder2

     

    Components:

     

    Component1's pickup path: \

     

    Component2's pickup path: \

     

    Also consider using the Automation Interface to update your Path Variables. Do a search on "InstallShield IswiAuto" and you'll get a number of hits, and ask questions here if you need to. I used to use the -l command line argument, but I've switched over to the Automation Interface.
    Expand Post
  • Thank you for your reply.

     

    The paths I'm referring to are the "Link to" paths for each file within a component. At least in my projects, if you click on the "Files" section of a component, then select a file, there is a "Link To" column displaying the file path where each file is picked-up.

     

    My PATH_ROOT path variable doesn't have to be as simple as C:\. This path is the common folder path that most of the other file paths share. So, it could be something like:

     

    PATH_ROOT.....C:\Projects\ProjectA\Branch1\

     

    PATH_A...........\FilesA\

     

    PATH_B...........\FilesB\

     

    So if I had an assembly in a component called "MyAssembly.dll" and it's "Link To" path was defined as "", I'd expect that it's full path would be:

     

    C:\Projects\ProjectA\Branch1\FilesA\MyAssembly.dll

     

    However, if I changed the PATH_ROOT using the -l switch to "D:\OtherProjects\" when calling IsCmdBld.exe, I'd expect the path of "MyAssembly.dll" to then be:

     

    D:\OtherProjects\FilesA\MyAssembly.dll

     

    However, this doesn't seem to work. The path stays at whatever I originally set PATH_ROOT to.
    Expand Post
  • " GarrettDyer wrote:

     

    Can you not make your Link To path this:

     

    \FilesA

     

    and

     

    \FilesB "

     

    How would I do that? Seems like InstallShield just wants (or creates) a path variable when ever I add a new file to a component. I don't see any way to modify the "Link To" path(?)

     

    (FYI... although I've been using InstallShield for quite a while, I'm hardly an expert, so pardon me if I don't know how to do something that I really should know how to do ;) )
    Expand Post
  • You and me both, so don't sweat the ignorance. It's a complex monster, to be sure...

     

    You're using Dynamic Links, correct...and is it a MSI or InstallScript project? Maybe I'm assuming incorrectly. Either way, you should just be able to type that value in.

     

    When you originally add the component, it may create a new Path Variable for the given component's file pickup path, but I always go back and make sure it makes sense, because it can't know the absolute best way to create the variable. You should be able to type over whatever it assigns as the path variable name, and then adjust your path variables accordingly.
    Expand Post
  • Ah, I see what you're saying now...there's no way to adjust the path to the given Static-linked file. Bummer.

     

    Guess you'll need to adjust 2 Path Variables in your build, then...

Loading
Path Variables in Path Variables