Installing on M:\

Fra Robin

Gå til: navigasjon, søk

Windows

Most installers comes with a self extracting .exe file that requires admin-privelegues to be run directly. However many such files are quite often nothing more than a zip- archive, that can be extracted using 7zip or any other unzipping program. Unzipping to your own home area (the M: disk) does not require any special privelegues.

Typically this can be done by right-clicking on the file and selecting:

7Zip->"Pakk ut..." or "Extract...".


Environment Variables

Sometimes, programs need certain Environment variables set. The self extracting-exe tends to take care of those using admin privelegues, thus making the program available to all users. However if you are installing on your own disk area, you can use the program on any machine as long as the environment variable are set.

Without admin-privelegues you can only set environment variables for your own user. Now as the control panel option likely is unavailable, environment variables and paths can be set command line:

cmd 
> setx MY_VARIBLE MY_VALUE
SUCCESS: Specified value was saved 

Note that the cmd window will not be able to utilize the newly set environment variable, but it will remain on the machine as long as your profile lingers. To test that you set the variable correctly, simply open a new cmd window, and have the variable echoed:

cmd
> echo %MY_VARIABLE%
MY_VALUE

For students changing machines, you might want to create your own .bat script that does the setx command for you. (simply add the setx line to a text file and save on your desktop as <myScript>.bat).

If you are very quick starting the next program after running your .bat script, the environment variable may not have come into effect yet. To counter this, simply click on an empty space on the desktop, then hit the 'F5' key for update.

Linux

  • Unzip, or untar your program files in an appropriate folder
  • create your own sourcefile containing and exporting the environment variables needed.
> gedit .bash_example &
#!/bin/bash

# an environment variable 

MY_VARIABLE=MY_VALUE
export MY_VARIABLE

# path extension example, 
# use $PATH to preserve the existing path while adding your path:

MYPATH=/mydir1/mydir2
PATH=$MYPATH:$PATH
export PATH
  • create a script that can utilize the bash script
>gedit run_example &

#!/bin/bash

# load environment variables
source .bash_example

# start my-program, or a session using the variables
gnome-terminal &

make the run-example runnable, and run it

> chmod 750 run_example
> ./run_example
Personlige verktøy