From: Uno on 14 May 2010 18:31 James van Buskirk describes in detail how to get a 32-bit dos window to open in the right spot and with the right properties: > I poled around a little and found that the thumb drive letter can be > given by %cd:~0,2% > > So I followed this procedure to install 32-bit gfortran on a thumb > drive: > > Find big enough thumb drive (e.g. 128 MB was too small) and insert > into USB slot. > > Start up windows Explorer with <WINDOWS>+E key combination, navigate > to thumb drive root, and clean up root directory. I just created a > new directory call "Backup" and dragged everything into it. > > Then create a new directory call gcc_eq32 in the root directory. > > Start Internet Explorer and go to www.equation.com, click on the > Programming Tools link, then the Fortran,C,C++ link and scroll > down to Download: Weekly Snapshot, and click on the link to > download the 32-bit snapshot. When the little window pops up > and asks if you want to run of save, click on Save and navigate > to your thumb drive and the gcc_eq32 directory, then click on > Save. > > Now back in Windows Explorer, navigate to the gcc_eq32 > directory and double-click the installation executable that > you just downloaded. Accept the terms, and in the next > dialog box click on browse and browse to the gcc_eq32 > directory. Click OK but delete the extra \gcc in the > installation directory name, then click on Install. > > After installation, you need a couple of extra things to > make this work cleanly. First, select your gcc_eq32 > directory in Windows Explorer and from the menu bar select > File | New | Text document. Change the name to Shortcut.bat, > right-click on the file and select Edit from the drop-down > menu. Paste in this stuff: > > @echo off > Title Build environment for 32-bit gfortran equation solutions > set > path=%cd:~0,2%\gcc_eq32\bin;%cd:~0,2%\gcc_eq32\libexec\gcc\i686-pc-mingw32\4.5.0;%path% > set EQ_LIBRARY_PATH=%cd:~0,2%\gcc_eq32\i686-pc-mingw32\lib;%EQ_LIBRARY_PATH% > cd %cd:~0,2%\gcc_eq32 > > (correct any line wraps above) and then exit Notepad, saving the file. > > Next, start up another instance of Windows Explorer and using the > right mouse button, drag and drop C:\WINDOWS\system32\cmd.exe to the > root directory of your thumb drive and select Create Shortcut from > the drop down menu. Right-click on the shortcut, select Properties, > and under the General tab change the name to > Command Prompt for 32-bit gfortran > Under the shortcut tab, change the target to > C:\WINDOWS\system32\cmd.exe /K %cd:~0,2%\gcc_eq32\Shortcut.bat > Change Start in to > %cd:~0,2%\gcc_eq32 > And under the Options tab, make sure that QuickEdit mode > and Insert mode are checked. Click on OK, and you should have > a working thumb drive installation. I have 32 bit xp on my own machine, so I doubt that I can do anything with it. But if I have a similar set-up with a 64-bit install, do I have to find a command.exe that is also 64-bit? I had better luck with the batch files when I used them to set the directory to start in, adding the lines: set dir=%~dp0 echo Dir for this script: %dir% cd %dir% This notation also makes for a shorter path variable, which is good because foldover is a bad thing. Anyways, fishing for tips to enter the 64-bit windows world. -- Uno
From: Erik Toussaint on 14 May 2010 19:28 On 15-5-2010 0:31, Uno wrote: > James van Buskirk describes in detail how to get a 32-bit dos window to > open in the right spot and with the right properties: > >> I poled around a little and found that the thumb drive letter can be >> given by %cd:~0,2% >> >> So I followed this procedure to install 32-bit gfortran on a thumb >> drive: >> >> Find big enough thumb drive (e.g. 128 MB was too small) and insert >> into USB slot. >> >> Start up windows Explorer with <WINDOWS>+E key combination, navigate >> to thumb drive root, and clean up root directory. I just created a >> new directory call "Backup" and dragged everything into it. >> >> Then create a new directory call gcc_eq32 in the root directory. >> >> Start Internet Explorer and go to www.equation.com, click on the >> Programming Tools link, then the Fortran,C,C++ link and scroll >> down to Download: Weekly Snapshot, and click on the link to >> download the 32-bit snapshot. When the little window pops up >> and asks if you want to run of save, click on Save and navigate >> to your thumb drive and the gcc_eq32 directory, then click on >> Save. >> >> Now back in Windows Explorer, navigate to the gcc_eq32 >> directory and double-click the installation executable that >> you just downloaded. Accept the terms, and in the next >> dialog box click on browse and browse to the gcc_eq32 >> directory. Click OK but delete the extra \gcc in the >> installation directory name, then click on Install. >> >> After installation, you need a couple of extra things to >> make this work cleanly. First, select your gcc_eq32 >> directory in Windows Explorer and from the menu bar select >> File | New | Text document. Change the name to Shortcut.bat, >> right-click on the file and select Edit from the drop-down >> menu. Paste in this stuff: >> >> @echo off >> Title Build environment for 32-bit gfortran equation solutions >> set >> path=%cd:~0,2%\gcc_eq32\bin;%cd:~0,2%\gcc_eq32\libexec\gcc\i686-pc-mingw32\4.5.0;%path% >> >> set >> EQ_LIBRARY_PATH=%cd:~0,2%\gcc_eq32\i686-pc-mingw32\lib;%EQ_LIBRARY_PATH% >> cd %cd:~0,2%\gcc_eq32 >> >> (correct any line wraps above) and then exit Notepad, saving the file. >> >> Next, start up another instance of Windows Explorer and using the >> right mouse button, drag and drop C:\WINDOWS\system32\cmd.exe to the >> root directory of your thumb drive and select Create Shortcut from >> the drop down menu. Right-click on the shortcut, select Properties, >> and under the General tab change the name to >> Command Prompt for 32-bit gfortran >> Under the shortcut tab, change the target to >> C:\WINDOWS\system32\cmd.exe /K %cd:~0,2%\gcc_eq32\Shortcut.bat >> Change Start in to >> %cd:~0,2%\gcc_eq32 >> And under the Options tab, make sure that QuickEdit mode >> and Insert mode are checked. Click on OK, and you should have >> a working thumb drive installation. > > I have 32 bit xp on my own machine, so I doubt that I can do anything > with it. But if I have a similar set-up with a 64-bit install, do I have > to find a command.exe that is also 64-bit? > > I had better luck with the batch files when I used them to set the > directory to start in, adding the lines: > > set dir=%~dp0 > > echo Dir for this script: %dir% > > cd %dir% > > This notation also makes for a shorter path variable, which is good > because foldover is a bad thing. > > Anyways, fishing for tips to enter the 64-bit windows world. If I'm understanding it correctly, the method you quoted sets up a shortcut to the cmd.exe on the local machine, so if you run the script on a PC with a 64-bit version of Windows it will use a 64-bit version of the command console. This may sound counterintuitive, but on 64-bit installs of Windows the c:\windows\system32 directory contains 64-bit drivers and programs. Erik. P.s.: For enhanced portability, you could use the variable %SystemRoot% to replace all instances of c:\windows, i.e. %SystemRoot%\system32\cmd.exe. Some people don't install their OS in the default location.
From: Uno on 14 May 2010 18:52 On 5/14/2010 6:28 PM, Erik Toussaint wrote: > If I'm understanding it correctly, the method you quoted sets up a > shortcut to the cmd.exe on the local machine, so if you run the script > on a PC with a 64-bit version of Windows it will use a 64-bit version of > the command console. > This may sound counterintuitive, but on 64-bit installs of Windows the > c:\windows\system32 directory contains 64-bit drivers and programs. > > Erik. > > P.s.: For enhanced portability, you could use the variable %SystemRoot% > to replace all instances of c:\windows, i.e. > %SystemRoot%\system32\cmd.exe. Some people don't install their OS in the > default location. Cool, cool, Erik. While I've got you on the hook, let me throw you a couple forehead scrunchers. Why would a person put in %path% when he's setting the path:? @echo off Title Build environment for 64-bit gfortran equation solutions set dir=%~dp0 set path=%dir%\bin;%dir%\libexec\gcc\x86_64-pc-mingw32\4.5.0;%path% set EQ_LIBRARY_PATH=%dir%\x86_64-pc-mingw32\lib echo Dir for this script: %dir% cd %dir% and what can you do about foldovers so as not to make them happen? Thx and cheers, It's the weekend! -- Uno
From: Jackie on 14 May 2010 19:54 On 5/15/2010 00:31, Uno wrote: > I have 32 bit xp on my own machine, so I doubt that I can do anything > with it. But if I have a similar set-up with a 64-bit install, do I have > to find a command.exe that is also 64-bit? Like Erik said, the native 64-bit version of cmd.exe on a 64-bit system would be in %SystemRoot%\System32. In order to support 32-bit applications as well, 32-bit copies of the system files are stored in %SystemRoot%\SysWOW64 as well.
From: Jackie on 14 May 2010 19:59
On 5/15/2010 00:52, Uno wrote: > > Why would a person put in %path% when he's setting the path:? > This is an environment variable containing search paths for the system. Say you have an application located at "C:\something\runme.exe". By adding the path "C:\something" to the path environment variable, you can simply launch "runme.exe" in the command line prompt (other places as well? haven't really tested) and the system will automatically find it in that path. |