You are here

Command Prompt Portable + UnxUtils + UTools = Portable Colored Console Goodness

8 posts / 0 new
Last post
page2pagepro
Offline
Last seen: 1 year 5 months ago
Joined: 2012-05-24 17:01
Command Prompt Portable + UnxUtils + UTools = Portable Colored Console Goodness

In keeping with portability, and my "Everest" of having every tool leaving no 'footprint' in windows, I use the following for portable console development.

For this example, let's assume your 'portable' drive is "P:\" - (I actually use a 2nd sata drive for my portable apps as not to fill up my SSD Win7 Ultimate OS drive)

Process:

  1. Download files
  2. Create Directory Structure
  3. Install Command Prompt Portable
  4. Copy UnxUtils.zip\usr\local\wbin\*.exe to bin folder
  5. Copy msls231.exe\*.exe to bin folder (overwriting 3 files)
  6. Modify commandprompt.bat

Basic layout:

  • P:\PortableApps
  • P:\PortableApps\CommonFiles\bin\*.* (From UnxUtils)
  • P:\PortableApps\CommonFiles\bin\ls.exe (From utools - msls231.exe)
  • P:\PortableApps\CommonFiles\bin\grep.exe (From utools - msls231.exe)
  • P:\PortableApps\CommonFiles\bin\dircolors.exe (From utools - msls231.exe)
  • P:\PortableApps\CommandPromptPortable
  • P:\PortableApps\CommandPromptPortable\Data\Batch\commandprompt.bat

Downloads:

  • CommandPromptPortable_2.1.paf.exe
  • Download UnxUtils.zip
  • Download U-Tools - IMHO a better ls.exe, grep.exe & dircolors.exe

Change commandprompt.bat contents to:


@echo off
color 07
prompt $m$p$_$g
title Command Prompt Portable
cls
ver
FOR /F %%i IN ("..\CommonFiles\bin") DO SET PATH=%%~fi;%PATH%
SET LS_OPTIONS=-bhAC --more --color=auto --recent --streams
SET GREP_OPTIONS=--binary-files=text -d skip --color=auto

I have included the final version for clarity - I do not have all the GNU licenses, nor kudos for those hard working development teams, but I do wish to thank each an every one of you!

final
To test:

  • Run CommandPromptPortable.exe
  • ls -laR
  • ls -l | grep -i "p.h"

thx!
-GC

marcdw
Offline
Last seen: 6 months 3 weeks ago
Joined: 2008-01-25 02:51
Nice CLI tips

I was pleased to see this. I've had something like this setup already but
with only a few choice tools (msls stuff, updated less, most, zip/unzip,
aria2c, xxcopy, couple of others).
After reading this I finally decided to augment the tools with stuff from
UnxUtils and the corresponding UnxUpdates. Could also use some updated
gnuwin32 stuff but nah! This is good enough.

This along with a "portable-ized" TCC v13 setup I have as well as
ConsolePortable and we have command-line goodness wherever we go. Smile

Now I just need a simple editor for quick edits. Any ideas?

Marc

Edit: There's a standalone vim 6.3 in the GOW Project's archive that
seemed to work okay but...
[ fyi: GOW is a project that seems to package up UnxUtils along with
various other bits of stuff like the putty tools (scp/sftp batches),
ncftp, vim, curl, rsync, and wget w/SSL ].

http://wiki.github.com/bmatzelle/gow/

page2pagepro
Offline
Last seen: 1 year 5 months ago
Joined: 2012-05-24 17:01
Cygwin, MinGW, GOW, SDK, JDK, NDK

Great tip Marc!

I do keep Cygwin portable, but it is rather bloated - I had not yet seen GOW - I have some reading to do Wink

Alternative for pseudo Linux without the cygwin1.dll Linux API layering is MinGW with MSYS. Nice for Cross (Platform) Compiling.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Referring back to the commandprompt.bat file, if one needs to add additional "CommonFiles" directories to the PATH environment variable, simply add another FOR Loop line per entry.

i.e.For Android SDK (ADB/Fastboot); Android NDK; Java JDK:


@echo off
color 07
prompt $m$p$_$g
title Command Prompt Portable
cls
ver
FOR /F %%i IN ("..\CommonFiles\bin") DO SET PATH=%%~fi;%PATH%
FOR /F %%i IN ("..\CommonFiles\android-sdk\platform-tools") DO SET PATH=%%~fi;%PATH%
FOR /F %%i IN ("..\CommonFiles\android-ndk-r8") DO SET PATH=%%~fi;%PATH%
FOR /F %%i IN ("..\CommonFiles\jdk1.7.0_04\bin") DO SET PATH=%%~fi;%PATH%
FOR /F %%i IN ("..\CommonFiles\jdk1.7.0_04\jre\bin") DO SET PATH=%%~fi;%PATH%
FOR /F %%i IN ("..\CommonFiles\MinGW\bin") DO SET PATH=%%~fi;%PATH%
SET LS_OPTIONS=-bhAC --more --color=auto --recent --streams
SET GREP_OPTIONS=--binary-files=text -d skip --color=auto

Cygwin: link
MinGW: link

PS: Cygwin portable will run as a separate app, hence not adding it to the batch script. However, I would recommend removing everything in the folder "P:\PortableApps\CygwinPortable\App\Cygwin", grabbing the setup.exe link, install selectively choosing your modules to the now empty folder.

thx!
-GC

marcdw
Offline
Last seen: 6 months 3 weeks ago
Joined: 2008-01-25 02:51
Dev-C++

Got one more goody for ya. You may be familiar with Dev-C++, an IDE that
comes bundled with MinGW, but it hasn't been developed in some time.
The alternative was to grab wxDev-C++ that also bundles wxWidgets and a
RAD tool.
Well it seems someone has forked Dev-C++ back in 2011, fixing bugs, etc.,
and adding in the latest TDM GCC (64-bit which the maintainer claims works
just fine on 32-bit systems).
Anyhind, he also has a portable version, too, which I plan on installing
today.
Check it out at http://orwellengine.blogspot.com/

Marc

bill_gagliardi
bill_gagliardi's picture
Offline
Last seen: 8 months 1 day ago
Joined: 2008-11-05 22:44
This was portablized today

Just wanted to share that this was portablized by scriptdaemon today (June 5th) It's located at Orwell Dev-C++ Portable 5.2.0.2 Development Test 1. This is an interesting thread. I'm gonna have to watch this one... Smile Peace...

Bill G.
Frozen St. Paul, MN
land of the frozen mosquito

scriptdaemon
Offline
Last seen: 5 years 1 week ago
Developer
Joined: 2008-10-10 17:40
wxDev-C++

I also have a dev test for wxDev-C++ in the forums, but it currently crashes so I'm trying to sort out the issues with it.

marcdw
Offline
Last seen: 6 months 3 weeks ago
Joined: 2008-01-25 02:51
Dev-C++ updated URL

Orwell's URL has changed. Now it's at

http://orwelldevcpp.blogspot.com/

Moddedout
Offline
Last seen: 12 years 3 months ago
Joined: 2011-05-10 07:50
TCC Portable

I paid for a license for TCC and want to make it portable so I can use it on the three systems I use in the 2 offices I work at and my laptop. Can you enlighten me as to how I can portablize mine? Bear in mind I am a portablizing illiterate. Biggrin

Log in or register to post comments