Where should I install my program on someone's computer?

175 Views Asked by At

I have been writing some simple scripts in C++ for my Physics lab experiments (at uni), and am wondering where to make my setup file install my programs to on somebody else's computer?

What is the best practice for this on Windows and Mac/Linux?

1

There are 1 best solutions below

5
On

For Windows, in "Program Files" for native mode (i.e. 32-bits programs on 32-bits Windows, 64-bits programs on 64-bits Windows).

A 32-bits program on a 64-bits Windows should be in "Program Files (x86)". You have environment variables to get the real paths of these folders, or you can use also Win32 API to retrieve them.

There is other things to think about, like where to save data produced by your application (usually, a subfolder of %APPDATA%). This directory must contains ALL files who are written by your program, like configuration file, since "Program Files" is write-protected in a non-elevated process.

Please also note that global resources, i.e. writable and used by ALL users, should go in "ProgramData" instead of user's profile.