Jump to content

Get Launchy "autorunned"


Creator
 Share

Recommended Posts

Im using Launchy, a keystroke app launcher (http://www.launchy.net) on my USB stick for portable use.

When configuring autorun for launchy on my stick i noticed that just adding the needed information to autorun.inf didnt work.

Then i tried writing an autoit wrapper to accomplish the autorun, but run, runwait, shellexecute and shellexecutewait cant seem to launch Launchy (which i still find strange)

I dont know if its a Vista-only problem, but i made an easy short scriptlet to make the launch of Launchy work (and at least vista-proof).

Launchy also has no native trayicon and i always want to SEE if launchy is running (check before ejecting my stick ex.) so there will be a trayicon for seeing if launchy is running.

My config on stick:

* Compiled script in root of usbstick (PortableLaunchy.exe)

* Launchy folder in root of usbstick (ex. usbroot:\Launchy\)

* autorun.inf

[Autorun]

Open=PortableLaunchy.exe

Action=Start Launchy

Icon=Launchy\Launchy.exe

Label=TITANIUM

Opt("OnExitFunc", "OnExit")
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)

TrayCreateItem("Exit")
TrayItemSetOnEvent(-1,"TrayExit")

$arShortcut = FileGetShortcut(@ScriptDir & "\Launchy\Launchy.lnk") 

If @error Then
    FileCreateShortcut(@ScriptDir & "\Launchy\Launchy.exe", @ScriptDir & "\Launchy\Launchy.lnk", @ScriptDir & "Launchy\")
Else
    If Not StringUpper(StringLeft($arShortcut[0], 1)) = StringUpper(StringLeft(@ScriptDir, 1)) Then
        FileDelete(@ScriptDir & "\Launchy\Launchy.lnk")
        FileCreateShortcut(@ScriptDir & "\Launchy\Launchy.exe", @ScriptDir & "\Launchy\Launchy.lnk", @ScriptDir & "Launchy\")
    EndIf
EndIf

ShellExecuteWait(@ScriptDir & "\Launchy\Launchy.lnk")

Func TrayExit()
    Exit
EndFunc

Func OnExit()
    if ProcessExists("Launchy.exe") Then
        ProcessClose("Launchy.exe")
    EndIf
EndFunc

there is not much new or complicated in this script, but for ppl who have problems autorunning launchy in a portable environment, it might offer a solution :P

Edited by Creator
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...