Portable Desktop Apps?

Hi All,

I have several small applications for both Mac OS X and Windows 7/8/10 that launch several terminal/cmd windows as part of the program. I would like to be able to run from any USB Thumb drive without having to specifically name the USB Thumb drive and map my apps to a specific path. IS this doable?

For example, one of my Mac apps use the sh.Execute command, but I have to map directly to a specific location. I want to be able to launch the created shell script from within the app itself from any USB drive I happen to have my app stored on. Same for Windows and the command line.


Sounds like you want to use RELATIVE vs ABSOLUTE paths…
So what are you doing (or not) that is causing a problem…

GETFOLDERITEM("") will return a path relative to where the APP is (which would be your thumbdrive)
from there it is a matter of deciding if you need to go UP (parent), or DOWN (adding CHILD branchs)…

Hi Dave,

So this is where I am writing my shell script to:
Dim file as FolderItem
file = App.ExecutableFile.Parent.Parent.Child(“Resources”).Child(“ESI_Logging.sh”)

But this is how I am having to access it currently:

Dim sh As New Shell
sh.Execute(“chmod +x /Applications/ESI_Logger_Mac.app/Contents/Resources/ESI_Logging.sh; exit”)
sh.Execute(“open -a ‘Terminal.app’ /Applications/ESI_Logger_Mac.app/Contents/Resources/ESI_Logging.sh; exit”)

I think you are right about the relative paths, I am just not sure how to get the Relative Path configured.

You already write it in the correct location using a path relative to the app exe
Why not use that to execute it as well instead of a hard coded path ?
something like

file = App.ExecutableFile.Parent.Parent.Child("Resources").Child("ESI_Logging.sh")

Dim sh As New Shell
sh.Execute("chmod +x " +  file.NativePath + "; exit")
sh.Execute("open -a 'Terminal.app' " +  file.NativePath + "; exit")

Norman got there before I did :slight_smile:

Awesome! Thanks guys. I just couldn’t quite get the right combination.