Create a Windows Sandbox: Difference between revisions

From VrlWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
This page is under construction
=Setting up $G on a Remote Windows System=
 
=Open Issues=
 
* C++ Express is for 2010.  2010 has not been tested.
No Express version has been tested.
 
* The zip file is 1.7GB and will grow.
This may slow over broadband - one time setup.
Make a program to create a Dvd with a setup.exe
 
* Raw CVS access does not check for merging.
Recent changes can be overwritten if they collide.
 
* Raw CVS access does not enforce end of line.
Cygwin CVS messes up if CR/LF text is checked in.
 
* Transferring files from CS to the outside requires VPN.
It can be slow from off site and is unreliable.
Set up scp for Windows?
 
* Copying large data set may not be possible.
Make Dvd distributions available?
 
* Setting up environment variable is not automated.
A Power Shell script or C++ program can write to the registry.
A Dos shell script can only work for a session.
See -visual/windows/registry.cpp for a C++ example.
Note that the user has to logout and login to see the variable.
 
=Background Technical Analysis=
 
User Variables: HKEY_CURRENT_USER\Environment
 
System Variables: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
 
Here's a good article on this with other links:
 
http://vlaurie.com/computers2/Articles/environment.htm
 
Note that any environment variable that is in the form that needs to be expanded (for example, %PATH%) must be stored in the registry as a REG_EXPAND_SZ registry value. Editing the Registry is primarily for scripts used by systems administrators and is not recommended for the average PC user.
 
http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/95e57430-9bd1-40af-8490-aa55b4e5b1cd
 
http://wiki.answers.com/Q/How_do_you_set_registry_entry_as_environment_variable
 
<pre>
REG ADD HKCU\Environment /v fred /d 1234 /t REG_SZ ]
REG QUERY HKCU\Environment /v FRED
 
PS Z:\> REG QUERY HKCU\Environment /v PATH
 
! REG.EXE VERSION 3.0
 
HKEY_CURRENT_USER\Environment
    PATH        REG_EXPAND_SZ  C:\cygw;C:\G\Vizualization\Wristvizualizer\Bin\D
ebug;c:\g\import\sdl\sdl_1.2.14_cl8\lib;C:\cygwin\bin;C:\cygwin\usr\X11R6\bin;/u
sr/X11R6/bin;/bin;Z:\Import\Qt\Win32_4.4.3\Bin;.;C:\cygwin\bin;C:\cygwin\usr\X11
R6\bin;/usr/X11R6/bin;/bin;.
</pre>
 
NOTE: This will not update the current environment, neither in the current command window nor in other windows (of any type). ou must logout and login for the changes to be picked up r you'll need to compile the following code-lette which I got from the MSDN reference:
 
<pre>
#include <windows.h>
 
int main(int argc, char* argv[])
{
DWORD_PTR dwReturnValue;
 
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,
(LPARAM) "Environment", SMTO_ABORTIFHUNG,
5000, &dwReturnValue);
return 0;
}
</pre>
 
Type REG at a command prompt for more details.
 
http://www.wilsonmar.com/1envvars.htm
 
These system  environment variables are  automatically created  by Windows upon boot-up in Windows Registry key
 
HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Control\
    Session Manager\ Environment
 
User  environment variables are stored in Windows Registry HKEY_CURRENT_USER\Environment
 
By application programs using Windows OS API functions. This is commonly done by application installation programs.
 
See:  -visual/windows/*.bat for cvs checkin
 
scp user@remote:file  file
dos2unix file
cvs update  file
cvs ci file
cvs commit  file
 
cvs co project/<project>
scp project/<project>  remote:sandbox/project
 
unix:  cvs co project/<project>
  win:  cvs co project/<project>
 
=Manual Process for Setting up $G on a Remote Windows System=


==Install Prerequisite Third Party Software==
==Install Prerequisite Third Party Software==
Line 126: Line 22:




==Directories that make up a remote sandbox==
==Setup Directories For Your Sandbox==


You can either populate your sandbox directories From the CS file system or unzip the remote Windows zip file.
You can either populate your sandbox directories From the CS file system or unzip the remote Windows zip file.


* '''Remote WIndows Zip File Setup'''
* '''Remote Windows Zip File Setup'''


   The zip file is located here:
   The zip file is located here:
Line 179: Line 75:
   install_WIN32\*                From /map/gfx0/tools/public/clone/install_WIN32/...
   install_WIN32\*                From /map/gfx0/tools/public/clone/install_WIN32/...


==Set Environment variables==
 
 
Setup the $G environment variables.


<pre>
<pre>
      G - At %G%\common
        G - At %G%\common
            %G%\import
              %G%\import


    GTO - At %GTO%\install_WIN32
      GTO - At %GTO%\install_WIN32


  GROOT - At %GROOT%\data
    GROOT - At %GROOT%\data


  GARCH - WIN32
    GARCH - WIN32


  PATH - %G%\import\make\g.utility_1.0;%PATH%
G_IMPORT - Set to the import directory:  %G%/import
 
    PATH - %G%\import\make\g.utility_1.0;%PATH%
</pre>
</pre>


Line 206: Line 106:
                         GARCH to:  WIN32
                         GARCH to:  WIN32
                         PATH to:  c:\g\import\make\g.utility_1.0;%PATH%
                         PATH to:  c:\g\import\make\g.utility_1.0;%PATH%


==Building software==
==Building software==
Line 226: Line 127:
   > make all
   > make all
   > make install
   > make install
=Open Issues=
* C++ Express is for 2010.  2010 has not been tested.
No Express version has been tested.
* The zip file is 1.7GB and will grow.
This may slow over broadband - one time setup.
Make a program to create a Dvd with a setup.exe
* Raw CVS access does not check for merging.
Recent changes can be overwritten if they collide.
* Raw CVS access does not enforce end of line.
Cygwin CVS messes up if CR/LF text is checked in.
* Transferring files from CS to the outside requires VPN.
It can be slow from off site and is unreliable.
Set up scp for Windows?
* Copying large data set may not be possible.
Make Dvd distributions available?
* Setting up environment variable is not automated.
A Power Shell script or C++ program can write to the registry.
A Dos shell script can only work for a session.
See -visual/windows/registry.cpp for a C++ example.
Note that the user has to logout and login to see the variable.
=Background Technical Analysis=
User Variables: HKEY_CURRENT_USER\Environment
System Variables: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Here's a good article on this with other links:
http://vlaurie.com/computers2/Articles/environment.htm
Note that any environment variable that is in the form that needs to be expanded (for example, %PATH%) must be stored in the registry as a REG_EXPAND_SZ registry value. Editing the Registry is primarily for scripts used by systems administrators and is not recommended for the average PC user.
http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/95e57430-9bd1-40af-8490-aa55b4e5b1cd
http://wiki.answers.com/Q/How_do_you_set_registry_entry_as_environment_variable
<pre>
REG ADD HKCU\Environment /v fred /d 1234 /t REG_SZ ]
REG QUERY HKCU\Environment /v FRED
PS Z:\> REG QUERY HKCU\Environment /v PATH
! REG.EXE VERSION 3.0
HKEY_CURRENT_USER\Environment
    PATH        REG_EXPAND_SZ  C:\cygw;C:\G\Vizualization\Wristvizualizer\Bin\D
ebug;c:\g\import\sdl\sdl_1.2.14_cl8\lib;C:\cygwin\bin;C:\cygwin\usr\X11R6\bin;/u
sr/X11R6/bin;/bin;Z:\Import\Qt\Win32_4.4.3\Bin;.;C:\cygwin\bin;C:\cygwin\usr\X11
R6\bin;/usr/X11R6/bin;/bin;.
</pre>
NOTE: This will not update the current environment, neither in the current command window nor in other windows (of any type). ou must logout and login for the changes to be picked up r you'll need to compile the following code-lette which I got from the MSDN reference:
<pre>
#include <windows.h>
int main(int argc, char* argv[])
{
DWORD_PTR dwReturnValue;
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,
(LPARAM) "Environment", SMTO_ABORTIFHUNG,
5000, &dwReturnValue);
return 0;
}
</pre>
Type REG at a command prompt for more details.
http://www.wilsonmar.com/1envvars.htm
These system  environment variables are  automatically created  by Windows upon boot-up in Windows Registry key
HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Control\
    Session Manager\ Environment
User  environment variables are stored in Windows Registry HKEY_CURRENT_USER\Environment
By application programs using Windows OS API functions. This is commonly done by application installation programs.
See:  -visual/windows/*.bat for cvs checkin
scp user@remote:file  file
dos2unix file
cvs update  file
cvs ci file
cvs commit  file
cvs co project/<project>
scp project/<project>  remote:sandbox/project
unix:  cvs co project/<project>
  win:  cvs co project/<project>

Revision as of 18:35, 1 September 2010

Setting up $G on a Remote Windows System

Install Prerequisite Third Party Software

  • When working remotely at Brown you will want to have ssh and VPN set up. These tools are supported by the CS department tStaff. If you need help email: problem@cs.brown.edu
  http://cs.brown.edu/system/net_remote/


  • Visual Studio - You will need Studio to compile C++ projects.

In order to Build projects within studio you will need to create a project or solution file. You can check in the project file so it can be used elsewhere. However, be sure the project file only uses relative paths.

  http://www.microsoft.com/express/Downloads/#2010-Visual-CPP


  • Python - You will need Python to run scripts. The 3.1.2 version is recent byt any version from 2.6 on will do. Your projects may not require Python so you can defer this. Still Python is a great tool to install.
  http://www.python.org/download/
  http://www.python.org/ftp/python/3.1.2/python-3.1.2.msi


Setup Directories For Your Sandbox

You can either populate your sandbox directories From the CS file system or unzip the remote Windows zip file.

  • Remote Windows Zip File Setup
 The zip file is located here:
 /map/gfx0/tools/public/clone/RemoteWIN32.zip

Unzip the window setup package to your sandbox such that you have:

  <Sandbox>/common/
  <Sandbox>/import/
  <Sandbox>/install_WIN32/
  <Sandbox>/project/
  <Sandbox>/setupG.exe

Then go into your Sanbox directory and run: setupG.exe
This will modify the registry to set these environment variables:

     GROOT   GARCH   G    GTO   G_IMPORT


You need to logout or reboot for the settings to take effect.

Note that the zip file does not include the prebuilt QT package. If you want QT you should copy it from the CS file system.


  • Manual Setup From the CS File System

Only a few imports are needed for a given project. Since import directories can be large, just copy the ones you need. Alternatively you can just copy over the zip file with everything.

  common\*                       From /map/gfx0/tools/public/clone/common/
                                   or CVS if you want the latest version.
  import\make\*                  From /map/gfx0/tools/public/clone/import/make/
  import\<select imports>        From /map/gfx0/tools/public/clone/import/import/...


You only need to set up the project directories you will be working with.

  project\<select projects>      From CVS @ project/...


Unless you intend to use files from the data directory then you do not need to create a data directory. If you do need some data files then plan wisely because many are large.

  data\*                         From /map/gfx0/data/<select data>


When you perform a make install your project is installed under the %GTO%\install_WIN32\ directory. This directory will be created the first time you install a project. You can also copy pre-built projects from the clone area.

  install_WIN32\*                From /map/gfx0/tools/public/clone/install_WIN32/...


Setup the $G environment variables.

        G - At %G%\common
               %G%\import

      GTO - At %GTO%\install_WIN32

    GROOT - At %GROOT%\data

    GARCH - WIN32

 G_IMPORT - Set to the import directory:  %G%/import

     PATH - %G%\import\make\g.utility_1.0;%PATH%

In the simplest sandbox setup, unzip the common and import files to your sandbox directory.

For example if your sandbox is:  c:\g\
             You should set up:  c:\g\common\
                                 c:\g\import\

Set G, GTO, and GROOT all to your sandbox.

 For example if your sandbox is:  c:\g\
  Then set G, GTO, and GROOT to:  c:\g\
                       GARCH to:  WIN32
                        PATH to:  c:\g\import\make\g.utility_1.0;%PATH%


Building software

You can work from a command line using a Dos shell or Power Shell

  http://technet.microsoft.com/en-us/library/bb978526.aspx


Build the common utility libraries. Many things use this.

  > cd  common\utility
  > make all
  > make install


Build any other libraries you might want to use. You can do this as needed.

  > cd  ..\gg
  > make all
  > make install


Open Issues

  • C++ Express is for 2010. 2010 has not been tested.

No Express version has been tested.

  • The zip file is 1.7GB and will grow.

This may slow over broadband - one time setup. Make a program to create a Dvd with a setup.exe

  • Raw CVS access does not check for merging.

Recent changes can be overwritten if they collide.

  • Raw CVS access does not enforce end of line.

Cygwin CVS messes up if CR/LF text is checked in.

  • Transferring files from CS to the outside requires VPN.

It can be slow from off site and is unreliable. Set up scp for Windows?

  • Copying large data set may not be possible.

Make Dvd distributions available?

  • Setting up environment variable is not automated.

A Power Shell script or C++ program can write to the registry. A Dos shell script can only work for a session. See -visual/windows/registry.cpp for a C++ example. Note that the user has to logout and login to see the variable.

Background Technical Analysis

User Variables: HKEY_CURRENT_USER\Environment

System Variables: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

Here's a good article on this with other links:

http://vlaurie.com/computers2/Articles/environment.htm

Note that any environment variable that is in the form that needs to be expanded (for example, %PATH%) must be stored in the registry as a REG_EXPAND_SZ registry value. Editing the Registry is primarily for scripts used by systems administrators and is not recommended for the average PC user.

http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/95e57430-9bd1-40af-8490-aa55b4e5b1cd

http://wiki.answers.com/Q/How_do_you_set_registry_entry_as_environment_variable

 REG ADD HKCU\Environment /v fred /d 1234 /t REG_SZ ]
 REG QUERY HKCU\Environment /v FRED 

 PS Z:\> REG QUERY HKCU\Environment /v PATH

 ! REG.EXE VERSION 3.0

 HKEY_CURRENT_USER\Environment
    PATH        REG_EXPAND_SZ   C:\cygw;C:\G\Vizualization\Wristvizualizer\Bin\D
 ebug;c:\g\import\sdl\sdl_1.2.14_cl8\lib;C:\cygwin\bin;C:\cygwin\usr\X11R6\bin;/u
 sr/X11R6/bin;/bin;Z:\Import\Qt\Win32_4.4.3\Bin;.;C:\cygwin\bin;C:\cygwin\usr\X11
 R6\bin;/usr/X11R6/bin;/bin;.

NOTE: This will not update the current environment, neither in the current command window nor in other windows (of any type). ou must logout and login for the changes to be picked up r you'll need to compile the following code-lette which I got from the MSDN reference:

#include <windows.h>

int main(int argc, char* argv[])
{
DWORD_PTR dwReturnValue;

SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,
(LPARAM) "Environment", SMTO_ABORTIFHUNG,
5000, &dwReturnValue);
return 0;
}

Type REG at a command prompt for more details.

http://www.wilsonmar.com/1envvars.htm

These system environment variables are automatically created by Windows upon boot-up in Windows Registry key

HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Control\
    Session Manager\ Environment

User environment variables are stored in Windows Registry HKEY_CURRENT_USER\Environment

By application programs using Windows OS API functions. This is commonly done by application installation programs.

See: -visual/windows/*.bat for cvs checkin

scp user@remote:file  file
dos2unix file
cvs update  file
cvs ci file
cvs commit  file
cvs co project/<project>
scp project/<project>  remote:sandbox/project
unix:  cvs co project/<project>
 win:  cvs co project/<project>