Create a Windows Sandbox

From VrlWiki
Jump to navigation Jump to search

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 Project and Solution files so it can be used on other computers. However, be sure they only uses relative paths.

The following Microsoft site has a tab for for Visual Studio 9 (2008 sp1) and Studio 10 (2010). You only need to install Visual C++. The default build process for G3D 8 uses Studio 9. If you install Studio 9 then that will work with all the Brown software.

 http://www.microsoft.com/express/Downloads/


Depending on the version of Visual Studio you install you may need to also install the System Developers kit. Look in the Program Files directory under ""Microsoft SDKs/Windows" to see which versions of the SDK if any you have. You can download the Version 7.1 SDK here:

  http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b


  • Python - You will need Python to run scripts. The 3.1.2 version is recent but 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:

 /research/graphics/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 /research/graphics/tools/public/clone/common/
                                   or CVS if you want the latest version.
  import\make\*                  From /research/graphics/tools/public/clone/import/make/
  import\<select imports>        From /research/graphics/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 /research/graphics/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 /research/graphics/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 Notes (Not for end users)

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>