You are here

Automatically start Portable Apps on a TrueCrypt drive

15 posts / 0 new
Last post
Electronicowboy
Offline
Last seen: 14 years 1 month ago
Joined: 2007-01-03 14:51
Automatically start Portable Apps on a TrueCrypt drive

How do I make Portable Apps automatically start on a FLASH drive where I have a secure True Crypt volume? When True Crypt mounts the volume Portable Apps does not start.

Dagenham
Dagenham's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-03-23 06:19
Batch

If you familiar with batch files, try the following commands:

@echo off
rem mount the volume
[path_to_truecrypt]TrueCrypt.exe /b /l[drive_letter] /mrm /q /v [truecrypt_volume]
rem starting portableapps
[path_to_portableapps]StartPortableApps.exe

I'm using PStart in a similar way. It works.

Electronicowboy
Offline
Last seen: 14 years 1 month ago
Joined: 2007-01-03 14:51
Thank you but...

Where do I place this batch file? Where and how do I reference it so it starts automatically upon insertion?

Dagenham
Dagenham's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-03-23 06:19
TC Traveller

Examine the TrueCrypt Traveller setup, and the autorun.inf file belongs to it. You can specify other commands as well, like a batch (or a simple NSIS script) to do the job.

lococobra
lococobra's picture
Offline
Last seen: 16 years 8 months ago
Joined: 2007-11-29 19:31
A script just for you :)

Here's a part of a script I wrote that can be compiled using AutoIt that should do it slightly more reliably than the previously mentioned bat file. Here's what it does...

Upon being launched, it brings up a window for you to enter your truecrypt password in. Once you hit enter it unlocks your volume, launches pstart or portableapps, then waits until you close pstart/portable apps. Then it closes all program that you brought up from the time you put in your portable drive, and dismounts your truecrypt drive. Hope someone finds this helpful!

#include 
#NoTrayIcon

;Begin User Configuration Section
$LaunchApp = '\PortableApps\PStart\PStart.exe'
$TrueCryptExe = '\TrueCrypt.exe'
$TrueCryptVol = '\EncryptedDisk.vol'
;End User Configuration Section

$alphabet = StringSplit("abcdefghijklmnopqrstuvwxyz","")
$drives = DriveGetDrive("ALL")
$drives = _ArrayToString($drives,"",1)
$drives = StringRegExpReplace($drives, "[ :]", "")&"abc"
For $i = 1 to 26
	If StringInStr($drives,$alphabet[$i])=0 Then
		$FDL = $alphabet[$i]
		ExitLoop
	EndIf
Next
If StringLen($FDL)1 Then
	MsgBox(0,"Drive Launcher","There are no free drive letters!")
	KillNoCleanup()
EndIf
$drive = StringLeft(@AutoItExe, 2)
$volumefile = $drive&$TrueCryptVol
$password = InputBox("Password", "Please input the unlock code","","*",250,110)
$TCPID = Run($drive&$TrueCryptExe&" /v "&$volumefile&" /l "&$FDL&' /p "'&$password&'" /q')
If StringLen($TCPID)
Electronicowboy
Offline
Last seen: 14 years 1 month ago
Joined: 2007-01-03 14:51
Thanks

What do I do with this script? Do I place the text into my autorun.inf file? If so why did it not work? My work computer did nothing when the flash drive was inserted.

Dagenham
Dagenham's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-03-23 06:19
AutoIt

"a script I wrote that can be compiled using AutoIt"

You will need AutoIt (use Google) to compile the script. The output will be an executable file.

Electronicowboy
Offline
Last seen: 14 years 1 month ago
Joined: 2007-01-03 14:51
Thanks again

Thanks for going through the trouble to do this for me.

apperrault
Offline
Last seen: 9 years 4 months ago
Joined: 2007-12-05 10:06
Problems Compiling this...

I have looked for something like this and never found something i liked, this has real potential.

I tried to compile the script in AutoIt and i am getting some compile errors when i try.

The first one it has a problem with is line 1. It doesn't like the
#include

when i comment that line out, it throws an error here:
Z:\My Documents\Scripts\PortableApps.au3 (12) : ==> Unknown function name.:
$drives = _ArrayToString($drives,"",1)
$drives = ^ ERROR

I would love to get this working. Any assistance you can provide would be greatly appreciated.

app

RogerL
Offline
Last seen: 3 months 1 day ago
Joined: 2007-03-14 09:17
Lococobra, Thanks very much

Lococobra, Thanks very much for posting this script for AutoIT3. I've been looking to learn AutoIT for sometime and this has given me the start I needed. I now have ASuite, the apps and my data within a TrueCrypt volume just about working.

I would be very grateful if you would give some indication why you chose those sleep times.

Thanks, RogerL

lococobra
lococobra's picture
Offline
Last seen: 16 years 8 months ago
Joined: 2007-11-29 19:31
Oops!

Oops! apperantly portableapps forums doesn't parse out "<>" when it's in context... it thought that I was trying to make an html tag. What it should have been was:

#include <Array.au3>
Ryan McCue
Ryan McCue's picture
Offline
Last seen: 15 years 4 months ago
Joined: 2006-01-06 21:27
Nope.

It's up to you to escape HTML entities, like < and > with &lt; and &gt;

"If you're not part of the solution, you're part of the precipitate."

apperrault
Offline
Last seen: 9 years 4 months ago
Joined: 2007-12-05 10:06
OK, that helps but...

Now i am getting another error.

when i try and run the program, i get an AutoIt error right after i am prompted for the password.

Line 27
$TCPID = Run($drive&$TrueCryptExe&" /v "&$volumefile&" /l "&$FDL&' /p "'&$password&'" /q')

Error: Unable to execute the external program.

Am i missing something. I changed the name of the file to match my TrueCrypt file to match what i am using, but that is all that i have changed.

Thanks

app

lococobra
lococobra's picture
Offline
Last seen: 16 years 8 months ago
Joined: 2007-11-29 19:31
Hmmm...

Did you use the fully qualified path for your truecrypt exe?

I.E.

$TrueCryptExe = '\LaunchFiles\TC\TrueCrypt.exe'

If that doesn't work. Stick this in before that line...

Msgbox(0,'',$drive&$TrueCryptExe&" /v "&$volumefile&" /l "&$FDL&' /p "'&$password&'" /q')
Exit

You should be able to diagnose your problem based on that..

gasket
Offline
Last seen: 14 years 4 weeks ago
Joined: 2011-01-11 08:38
can't compile autoit script

thanks for the script, but i can't compile this script because an error

ERROR: AutoItSetOption() called with illegal argument 1: "OnExitFunc"
AutoItSetOption("OnExitFunc","")

why?

: : gasketto : :

Log in or register to post comments