You are here

Start Programs on Plugin and Eject

16 posts / 0 new
Last post
Isaac Waller
Offline
Last seen: 15 years 9 months ago
Joined: 2008-06-27 14:19
Start Programs on Plugin and Eject

version 0.4 - see comments for downloads

I have created a program that lets you start programs on plug-in or eject of the drive. It starts all programs listed in the Autostart.ini file and then the PortableApps.com Menu. You place it in the root directory of your drive (F:/,G:/,etc) and set it instead of StartPortableApps.exe as the Autorun executable. This program would be useful if you have Miranda or Portable Skype and you want to start it as soon as you plug it in. It is very simple, but some people may find it useful until it is integrated into the PortableApps.com Menu.

It is reccommended just to use the wizard found at http://www.isaacwaller.com/usbstart/ to create Autostart.ini files, as it is much easier.

What to change in Autorun.inf:

[Autorun]
Open=StartPortableApps.exe
Action=Start PortableApps.com
Icon=StartPortableApps.exe
Label=Isaac USB

to:

[Autorun]
Open=USBStart.exe
Action=Start PortableApps.com
Icon=StartPortableApps.exe
Label=Isaac USB

Thank you,
Isaac Waller

digitxp
digitxp's picture
Offline
Last seen: 13 years 2 months ago
Joined: 2007-11-03 18:33
Nice Work!

I and some others have made these types of apps, as they are probably the biggest thing that the menu is lacking currently. Taneth111 wrote MenuLauncher Portable, and I wrote UP ME and MultiLaunch. a plugin system in planning by Xopher (maggotb0y, author of geek.menu) where you can add plugins. See I am very bad at C++ (mainly because the structuring of the code bugs me) so I wrote mine in the same lang as the launchers, NSIS. Hopefully, autorunning multiple apps will be in the PAM 1.2/1.5/2.0 (whichever one it is).
And Welcome to PortableApps.com :D.

(BTW, you happen to know how to obtain the name of all executables within every subfolder of a given folder??? I'm trying to figure out the algorithm to write an app manager for the menu ;)).

Insert original signature here with Greasemonkey Script.

wraithdu
Offline
Last seen: 11 years 5 months ago
Developer
Joined: 2007-06-27 20:22
(BTW, you happen to know how
(BTW, you happen to know how to obtain the name of all executables
within every subfolder of a given folder??? I'm trying to figure out the
algorithm to write an app manager for the menu ;)).

What language? The basic idea is to start a search in your top directory for all files and folders (*.*). If a found item is a folder (do an attribute check) then you recurse into that folder doing the same thing, search for all (*.*). If the item is a file, check for the EXE extension and add it to your list. It'll end up being a small looking loop, but you call the function from within itself (recurse).

Now, in most languages this is fine because you can declare variables in a local scope (when recursing you won't overwrite your previous variables where you will store the search handles). NSIS doesn't make this distinction I don't think, so you might have trouble if that's your language.

EDIT - you're going to have issues in NSIS. From the manual -

4.2.1.1 Var
[/GLOBAL] var_name
Declare a user variable. Allowed characters for variables names: [a-z][A-Z][0-9] and '_'. All defined variables are global, even if defined in a section or a function.

digitxp
digitxp's picture
Offline
Last seen: 13 years 2 months ago
Joined: 2007-11-03 18:33
I suppose

AHK or Delphi or C++ (now that I got a book) or any C style language.

Insert original signature here with Greasemonkey Script.

Isaac Waller
Offline
Last seen: 15 years 9 months ago
Joined: 2008-06-27 14:19
USBStart Editor

For a easier way to create Autostart.ini files:
http://www.isaacwaller.com/usbstart/

digitxp
digitxp's picture
Offline
Last seen: 13 years 2 months ago
Joined: 2007-11-03 18:33
Off-Topic

is there any chance that I can see the PHP code for that page? I'm trying to learn PHP but the PHP book is in the Community College so I can't get it :(.

Insert original signature here with Greasemonkey Script.

Isaac Waller
Offline
Last seen: 15 years 9 months ago
Joined: 2008-06-27 14:19
http://www.isaacwaller.com/us
alpha1
alpha1's picture
Offline
Last seen: 9 years 6 months ago
Joined: 2007-07-08 20:02
.3 link is dead

.3 link is dead

Lead, Follow, or get out of the way.

Isaac Waller
Offline
Last seen: 15 years 9 months ago
Joined: 2008-06-27 14:19
Are you sure

It works for me...
Don't right-click and save target as because it goes to a webpage first.

alpha1
alpha1's picture
Offline
Last seen: 9 years 6 months ago
Joined: 2007-07-08 20:02
it works now, it was dead for

it works now, it was dead for about half an hour for me

Lead, Follow, or get out of the way.

Isaac Waller
Offline
Last seen: 15 years 9 months ago
Joined: 2008-06-27 14:19
version 0.4
  • Now you can close programs; #CLOSENotepad.exe will close Notepad.exe (do not put a starting directory!)
  • You can choose the executable for a menu:
    #MENUPStart\PStart.exe
    PStart
    Will start "PStart.exe" instead of the PortableApps menu. (you must put it before anything else, include a starting directory!)
  • Download:
    http://www.isaacwaller.com/download.php?id=7 - Executable
    http://www.isaacwaller.com/download.php?id=8 - Source

    Thank you, Isaac

pmlabrier
Offline
Last seen: 13 years 6 months ago
Joined: 2008-04-08 13:01
Not AutoStarting?

Here is my autorun.inf:

[Autorun]
Open=v04.exe
Action=Start PortableApps.com
Icon=StartPortableApps.exe
Label=My Brain

When the drive connects it is detected and goodsync starts its automatic synchronization but USBstart does not run. If I manually start it, it starts the program in my autostart.ini just fine and also the portable apps menu as well.

Paul

Isaac Waller
Offline
Last seen: 15 years 9 months ago
Joined: 2008-06-27 14:19
Are you sure autoplay is

Are you sure autoplay is enabled on that computer?
Try on another computer; if it works, it is probably the autoplay.

piotr.dobrogost
Offline
Last seen: 15 years 12 hours ago
Joined: 2009-01-28 15:00
ini description

Issac

Can you write a little description of the format of parameters in ini file?

--- Piotr Dobrogost

shoresh319
Offline
Last seen: 11 years 4 days ago
Joined: 2008-05-30 18:45
Great Idea

Please talk to the site's developers to make this feature integrated into the portableApps menu.

dfinf2
Offline
Last seen: 15 years 9 months ago
Joined: 2006-04-13 18:21
Wouldn't a batch file work

Wouldn't a batch file work just as well? Or is this mainly for people who don't want/know how to create a batch file? Just curious thanks and nice work!

Log in or register to post comments