[color:green];
; /shortcut <path\shortcut name> <path\program file> [path\icon [index]]
;[/color]
alias shortcut {
[color:green];
; This regular expression is for reordering quoted parameters
; in the $N identifiers.
;[/color]
if $regsub($1-,/("[^"]+"|\S+)\s?/g,\1 $+ $lf,%a) {
tokenize 10 %a
unset %a
}
[color:green];
; Creation of an INF file that contains the shortcut info
;[/color]
var %shortName = $+("",$nopath($1),"")
var %shortPath = $nofile($shortfn($1))
var %shortDesc = $+(",$nopath($2),")
var %progFullName = $+(",$2,")
if !$regex($2,^\S+://) {
[color:green];
; Set working path only if it's not a URL...
;[/color]
var %progPath = $nofile($gettok($shortfn($2),1,32))
}
window -h @sc
var %c = aline @sc
%c [version]
%c signature="$chicago$"
%c [DefaultInstall]
%c UpdateInis=Addlink
%c [Addlink]
%c setup.ini, progman.groups,, "group1= $+ %shortPath $+ "
%c setup.ini, group1,," $+ %shortName $+ , $+ %progFullName $+ , $+ $&
$3 $+ , $+ $4 $+ ,, $+ %progPath $+ , $+ %shortDesc $+ "
savebuf @sc sc.inf
window -c @sc
[color:green];
; Installation...
; [/color]
run rundll setupx.dll,InstallHinfSection DefaultInstall 132 $mircdirsc.inf
[color:green];
; And removal of the INF file after reasonable delay.
;[/color]
.timersc 1 5 .remove sc.inf
}