Page 1 of 2

Sandboxie Portable

Posted: Tue Sep 04, 2007 1:52 am
by lococobra
wraithdu at the Sandboxie forum has come up with a portable version of Sandboxie. I'm not 100% sure it's portable, but it seems pretty solid.

For those of you who don't know what Sandboxie is, it traps all of a program's I/O in a transient storage area, thus allowing you to run any app without letting it touch your computer in any way.

The program is donationware, but no registration is required to download/run the program.

Installation goes something like this:
• Download Sandboxie from Here
• Download SandboxiePortable from one of the following locations: Mirror1, Mirror2, Mirror3
• Extract SandboxiePortable to a location of your choosing
• Open the Sandboxie installer with 7zip and extract all files in the root directory to 'App\Sandboxie'
• Open the '$PLUGINSDIR' folder from the archive, and extract 'kmdutil.exe' to the same directory.
• If it's the first time you've done this installation, rename 'Sandboxie_default.ini' to 'Sandboxie.ini'

Run 'SandboxiePortable.exe' to launch the program.

Additional instructions are located in the README.txt packaged with SandboxiePortable.

I also coded a secondary launcher which re-writes the Sandboxie.ini file upon each launch so that the sandbox location is on your portable drive...

Here's how to use that script:
• Copy the contents of http://trappar.net/sandboxlauncher.txt into your favorite text editor and save it as 'Launcher.au3' in your root Sandboxie folder.
• Use Aut2exe (Distributed with AutoIt) to compile the script you just saved into 'Launcher.exe' located in the root of your Sandboxie folder.

Run Launcher.exe and pray that my configuration works with your setup, worst that's going to happen is you'll have to replace your Sandboxie.ini file located in 'App\Sandboxie'

Everything works great for me, I'd love to hear how it works for you guys.

Posted: Tue Sep 04, 2007 3:58 am
by spacemonkey
Ive been using this for a while now. Great app!!

BUT.. not totally portable as it writes files to the host computer (although you can add a secure erase feature).

Its great when you just carnt get JPE to work... but I still keep trying.

Posted: Tue Sep 04, 2007 10:19 am
by lococobra
I'm pretty sure that all the files it writes to the computer are erased upon program closure. If there's an error, files will be left behind, but there is an included cleanup program if this is the case.

The only folder that isn't deleted by default is the sandbox folder, but my launcher prevents this file from being written to the host computer.

Posted: Tue Sep 04, 2007 12:29 pm
by portackager
If you have sandboxie already installed, it will not work. :cry:

Posted: Tue Sep 04, 2007 2:26 pm
by lococobra
Then uninstall it :P

The portable version has all the functionality of the normal version, so whats the point of having the non-portable version?

Posted: Tue Sep 04, 2007 11:48 pm
by spacemonkey
lococobra, your little script works very nicely, Thanks :D

Posted: Wed Sep 05, 2007 1:22 am
by lococobra
Good to hear :D

Just as a side note, if you're using my script... the config file is actually included in the script, so if you want to change the config file in any way, you have to rewrite the script, then re-compile.

Hint: Use word-wrap :)

Posted: Wed Sep 05, 2007 2:16 am
by crownixx

Code: Select all

#Include <String.au3>
$ST = _StringReverse(@AutoItExe)
$SP = StringInStr($ST, '\')
$ST = _StringReverse($ST)
$ST = StringLeft($ST, StringLen($ST)-$SP+1)
$SIni = $ST&"App\Sandboxie\Sandboxie.ini"
$boxloc = $ST&"Data"
MsgBox(0,"Test",$SIni)
MsgBox(0,"Test",$boxloc)
Just wonder why you dont use @Scriptdir.its more simple

Code: Select all

$SIni = @Scriptdir & "App\Sandboxie\Sandboxie.ini"
$SIni = @Scriptdir & App\Sandboxie\Sandboxie.ini"
;MsgBox(0,"Test",$SIni)
;MsgBox(0,"Test",$boxloc)
and use IniWrite to write only on the [Global Settings] section,BoxRootFolder key

Posted: Wed Sep 05, 2007 5:40 am
by crownixx
try this and you dont need to rewrite and recompile the script. It will not interupt your others config in your Sandboxie.ini.

Code: Select all

#NoTrayIcon
$SIni = @ScriptDir & "App\Sandboxie\Sandboxie.ini"
$boxloc = @ScriptDir &"Data"
IniWrite ( $SIni, "GlobalSettings", "BoxRootFolder", $boxloc )
Sleep(100)
ShellExecute("SandboxiePortable.exe")

Posted: Wed Sep 05, 2007 1:53 pm
by lococobra
Thanks a bunch, those seem to be great fixes.

I didn't know about @ScriptDir or IniWrite, the only reason I was using notepad is because that ini is unicode, which means that if I try to edit it using regular file IO, the output file will be unreadable by sandboxie. Your solution is just what I was looking for the whole time :P

Thanks!

EDIT: Your script still had a couple problems, I modified it to fix them as well as implement some error trapping. Here's the new script.

Code: Select all

#NoTrayIcon
$SIni=@ScriptDir&"\App\Sandboxie\Sandboxie.ini"
$boxloc=@ScriptDir&"\Data"
If IniWrite($SIni, "GlobalSettings", "BoxRootFolder", $boxloc)=0 Then
	$perm = FileGetAttrib($SIni)
	MsgBox(16,"IniWrite Failed!","Unable to write new settings to Sandboxie.ini"&@CRLF&"File permissions: "&$perm)
Else
	Sleep(100)
	ShellExecute("SandboxiePortable.exe")
EndIf

Posted: Wed Sep 05, 2007 6:00 pm
by crownixx
Glad i could help :D

kmdutil.exe won't extract

Posted: Fri Sep 07, 2007 11:48 pm
by guinness
I have been trying to use 7-Zip and UniExtract but for some reason generates an error why?

Posted: Sat Sep 08, 2007 6:41 am
by guinness
When I was talking about extraction I was referring to the file KmdUtil.exe as an error is generated when using both these tools.

Posted: Sat Sep 08, 2007 9:52 pm
by lococobra
Just open the main directory in 7zip then go to the directory '$PLUGINSDIR'. You can also use UniExtract to extract the whole thing, then navigate to that directory.

If neither of those work, you could simply install the program, find KmdUtil.exe, move it to the required directory, then uninstall the program.

-Corrupt File-

Posted: Mon Sep 10, 2007 12:50 pm
by guinness
I tried that too, plus the file doesn't seem to be a correct .exe
What version of Sandboxie did you guys use to create the Portable Version? I have used 3.01 and for some reason even trying to open kmdutil.exe generates a warning of 'missing command'

I took your advice and installed to C:/ but kmdutil.exe doesn't seem to be embedded.

I need help as I am nearly there of creating a 99% secure USB Portable Drive for travelling around Europe :D