cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Phil_B
Level 3

Appending to the System Path

I'm building a system utility. I will be installing it in program files.

Before the install completes, I want to add a path of the install folder to the system path. I see how to add to the system path, but how do I know which path to add? How do I automate the correct one?

On some machines, the path I need to append will be:

[~];C:\Program Files\MyStuff

and on other machines

[~];C:\Program Files (x86)\MyStuff

How do I get past this dilemma?
Labels (1)
0 Kudos
(4) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Use a reference to a directory property instead of a hardcoded string. This will offer further benefit if the user overrides the installation location. Assuming this is your main installation directory, chances are you should use:

[~];[INSTALLDIR]
0 Kudos
Phil_B
Level 3

Ok, thanks. I'm on the first day of my trial so I didn't know about predefined variables. Is there a list somewhere?
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

That's a deeper and more complicated question than it sounds like. The items you're asking about are called Properties. There are lots of predefined ones from the system, and then there are a handful we add to projects by default for the base features we provide. Then more can show up for directories or text boxes or many other things you add to your project.

For the example of INSTALLDIR, you can see this in the Files and Folders view. It's listed in the tree, or you can right click the My Product Name [INSTALLDIR] node, and see that it's using Directory Identifier INSTALLDIR, and that's the name you would want to reference as a property. (Note that they are case sensitive.)
0 Kudos
Phil_B
Level 3

Thank you. I'm sure I'll correllate more of this as I go along.
0 Kudos