- The scripts which wants to have a shortcut, requests it at buildModel (same syntax as before)
- buildModel parses the syntax and writes the result into a ini file
- then buildModel calls the activated shell script [add-shortcut] which builds the shell's specific shortcuts.
Additionally I added a modified Xobelite script (from version 042 or similar) which adds some menu entries.
The code:
[Add-Shortcut] AddVariables,"%buildModelScript%","Variables" IniRead,#1,"Shortcut","shortCutType",%shortCutType% If,%shortCutType%,Equal,SM,Run,%ActiveShell%,Build-Shortcut,#1 [Build-Shortcut] If,NotExistFile,%XobDir%\menu.rc,Run,%ActiveShell%,run-first,#1 IniRead,#1,"Shortcut","shortCutName",%shortCutName% IniRead,#1,"Shortcut","shortCutExe",%shortCutExe% IniRead,#1,"Shortcut","shortCutParameters",%shortCutParameters% TXTAddLine,%XobDir%\menu.rc,"[exec] (%shortCutName%) {#$q%shortCutExe%#$q %shortCutParameters%}","Place","16" [run-first] ExtractFile,%ActiveShell%,"menu","menu.rc",%XobDir% TXTAddLine,%XobDir%\menu.rc,"[end]","Place","15" TXTAddLine,%XobDir%\menu.rc,"[submenu] (nativeEx SM)","Place","15" [process] // psc new shortcut mechanism IniWrite,"%ProjectDir%\script.project","Variables","#$pActiveShell#$p","%ScriptFile%" ...
Only the 'services' program runs well, taskmanager, notepad and regedit let Xobelite reboot. But that is a question of the Xobelite script, not of the shortcut mechanism.
BTW: buildModel parser accepts also Ove's syntax, with a small modification:
Commas, quotes, spaces etc must be replaced by the WinBuilder/Delphi escapes.
Sample of such a line:
Run,%BuildModelScript%,Add-Shortcut,"1","!WD\explorer.exe#$c!DE\RAMDrive#$c#$c/e!c%RAMDRV%
#$cGo#$sto#$sRAMDISK#$c!WD\system32\shell32.dll#$c#$c12"
IMPORTANT: For Xobelite and Ove's method you need WinBuilder version 068 beta 14a.
You can get it in the download area at WinBuilder > nativeEx_barebone.
Peter