Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 326

Portable Shortcuts via LWMenu

$
0
0
Well, as good as it gets anyway! I thought this might be of some use here.

After working on my GameBar launcher, I found any adjustments simply break the shortcuts where moving ROM's, emulators, or renaming anything obviously causes issues.

I searched and found a couple of useful ideas for portable shortcuts:
1. Creating BAT files. I didn't like this idea much, so I continued to look.
2. Use Shortcuts Search and Replace tool. I found this a hassle to use. It doesn't load all shortcuts from the folder you specify, doesn't always replace what you've specified and no real reason as to why that is!
3. Then I remembered a great little tool called AutoRun LWMenu! So I thought I'd share this here and a quick tutorial on it's usage.

I managed to convince the dev of the merits of adding several new functions, who very kindly added them, as you can read here.

This app acts as a bridge between LNK files and running an app with arguments. I found it very tedious creating many shortcut files and then having to rename them, which was the easy bit. The harder part was adjusting all the required arguments in the Target and Start in fields. I have requested LWMenu's developer to add a function to auto create LNK files from the data contained in LWMenu's config files. This allows easy editing, relative paths and a massively simpler and easier way to re-create shortcuts rather than edit existing ones.

Ok, so first, download the latest version from portablefreeware.com.
It's literally an EXE and an INF file. Just unzip and place anywhere. This little app has so many uses, that I can only cover how it is used in this context. Much of it's function is designed to make apps portable, originally being designed to show a boot menu for CD ROM's with custom items that can be launched either with or without showing the menu, it can clean up after an app has been run, and now, thanks to the dev's responsiveness, it is able to use Variables in a similar way to Rainmeter, you can now also have several Launchers in the same folder, and most importantly for this context, the best is that once you have set up a configuration, you can auto-generate LNK files for each 'button' entry of the menu.

Essentially, launching the app once unzipped will show a default template menu. It's a pretty simple affair, but it's true beauty lies in it's abilities, not in it's looks.
LWMenu.JPG
Here is a short example of a config that I have set up:
I have a root folder containing the following files:
autorun.inf - This is the configuration file.
AutoRun_x64.exe - This is the menu's executable, which, when run, will show a menu with a list of buttons.
mameui.exe - My chosen emulator to create shortcuts for.

Code:

[CUSTOM MENU]closemenuonclick=1           ; close the menu after launching an app. ie, doesn't show the menu on launching apps.singlerun=1                  ; Launch the filename just once.setenv=Path1|mameui.exe      ; This is used in the same way as you would create a Variable in Rainmeter.setenv=Path2|ini             ; Note that there's no need to add numbers after each setenv.[BUTTON1]buttontext=GW - Ball                                ; If you open the menu, this would be the name of each button.relativepathandfilename=%Path1%                     ; State an absolute or relative path, or as I have, set a Variable for ease of use.optionalcommandlineparams="%Path2%\gnw_ball.ini"    ; State your arguments, again with a path or Variable.                                                    ; REPEAT for every button.[BUTTON2]buttontext=GW - Balloon Fight - Crystalrelativepathandfilename=%Path1%optionalcommandlineparams="%Path2%\gnw_bfight.ini"[BUTTON3]buttontext=GW - Balloon Fightrelativepathandfilename=%Path1%optionalcommandlineparams="%Path2%\gnw_bfightn.ini"
The idea now is to launch AutoRun_x64.exe via a LNK file using these arguments:
Target: "X:\path-to-mameui\AutoRun_x64.exe" /skiptobutton=X
Start in: "X:\path-to-mameui"
Replace the first X with your drive letter and the last X with the button number you want that shortcut file to launch.
Doing this for 400 shortcuts is a major hassle!

Amazingly, the dev has agreed to add a new function that auto-generates LNK files.
This has the benefit of auto filling these arguments:
1. The Target and Start in fields are filled out with the current AutoRun_x64.exe's path.
2. Each shortcut will also have the argument /skiptobutton=X added to the Target field. The X being replaced by the specific button number.
3. Each LNK file will be named according to the setting given to the parameter buttontext= within the autorun.inf file.

This makes the whole concept of recreating shortcuts a doddle!

Statistics: Posted by sl23 — Yesterday, 1:06 pm — Replies 0 — Views 42



Viewing all articles
Browse latest Browse all 326

Trending Articles