PDA

View Full Version : Appending to the System Path



Phil_B
09-27-2011, 02:52 PM
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?

MichaelU
09-28-2011, 10:37 AM
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]

Phil_B
09-28-2011, 10:54 AM
Ok, thanks. I'm on the first day of my trial so I didn't know about predefined variables. Is there a list somewhere?

MichaelU
09-28-2011, 10:59 AM
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.)

Phil_B
09-28-2011, 12:21 PM
Thank you. I'm sure I'll correllate more of this as I go along.