Here's a bit of code to test in the "Code Box". Independent. Output is only Echoed to the Log. Can't get the %LinkDir% to resolve though. And still need to sort out the locations for Program Icons, and a bit more to do on Groups/Categories.
Had to change the names of the Sections because WinBuilder was having trouble finding them with the old names.
The [All_Type_Group] Section (renamed from [AddShortCut]) is pedrole15's idea.
Unpack/Depack looks like a challenge.
... trying to clarify what is required.
[codebox][main]
Title=CodeBox VistaPE Shortcut Test
Description=Running custom commands
// --> Add_Shortcut -> add a shortcut, next parameter defines where
// - AutoStart -> start with windows (e.g. Add_Shortcut,AutoStart,4)
// - Desktop -> place on the desktop (e.g. Add_Shortcut,Desktop)
// - StartMenu -> place on the start menu (e.g. Add_Shortcut,StartMenu)
// - QuickLaunch -> (e.g. Add_Shortcut,QuickLaunch)
// -> Add another parameter and it will be placed inside a
// folder on start menu (e.g. Add_Shortcut,StartMenu,Games)
[Variables]
# From Nightman's Documentation - seven!
# what, where, working folder, characteristics, description, icon, characteristics of window (normal|min|max)
%ProgramFolder%=MyProgramFolder
%OutDir%=%ProgramFolder%
%ProgramExe%=MyProgramExecutable
%Executable%=%ProgramExe%
%ProgramTitle%=MyProgramTitle
%ProgramName%=%ProgramTitle%
%Category%=MyStartMenuCategory
%StartParameters%=MyProgramParameters
%Description%=MyProgramDescription
%Icon%=MyProgramIconPath
%OpenWindow%=MyProgramWindow
%ProgramArchive%=MyProgramArchive
%ES%=%TargetDir%\windows\system32\shortcut.inf
Add_ShortcutStart_Menu=Run,%ScriptFile%,S_Exe_Title
Shortcut_Start_Menu=Run,%ScriptFile%,S_No_Parameters
AddShortcutStartMenu=Run,%ScriptFile%,S_Exe_Title
ShortcutStartMenu=Run,%ScriptFile%,S_No_Parameters
Add_Shortcut_Desktop=Run,%ScriptFile%,D_Exe_Title
Shortcut_Desktop=Run,%ScriptFile%,D_No_Parameters
AddShortcutDesktop=Run,%ScriptFile%,D_Exe_Title
ShortcutDesktop=Run,%ScriptFile%,D_No_Parameters
Add_Shortcut=Run,%ScriptFile%,All_Type_Group
AddShortcut=Run,%ScriptFile%,All_Type_Group
[Process]
########## UnComment One From Below ###########
#Run,%ScriptFile%,RunFromCD_Standard
#Run,%ScriptFile%,RunFromCD_Custom
Run,%ScriptFile%,RunFromRAM
########## UnComment One From Below ###########
Add_ShortcutStart_Menu,%ProgramExe%,%ProgramTitle%
#Shortcut_Start_Menu
#AddShortcutStartMenu,%ProgramExe%,%ProgramTitle%
#ShortcutStartMenu
#Add_Shortcut_Desktop,%ProgramExe%,%ProgramTitle%
#Shortcut_Desktop
#AddShortcutDesktop,%ProgramExe%,%ProgramTitle%
#ShortcutDesktop
#Add_Shortcut,StartMenu,%Category%
#Add_Shortcut,Desktop
#AddShortcut,StartMenu,%Category%
#AddShortcut,Desktop
[RunFromCD_Standard]
%LinkDir%="!PDC"
%DestDir%="Programs"
[RunFromCD_Custom]
%LinkDir%="!CD"
%DestDir%=""
[RunFromRAM]
%LinkDir%="!PF"
%DestDir%="Program#$sFiles"
Echo,"RunFromRAM OK"
[S_Exe_Title]
# Fn,ProgramExe,ProgramTitle
Set,"#9","%LinkDir%\%ProgramFolder%\#1"
System,RefreshVars
Set,"#1","#9"
Set,"#8","%Category%\#2.lnk"
System,RefreshVars
Set,"#2","#8"
Set,"#3","%LinkDir%\%ProgramFolder%"
Set,"#4","%StartParameters%"
Set,"#5","%Description%"
Set,"#6","%Icon%"
Set,"#7","%OpenWindow%"
System,RefreshVars
Run,%ScriptFile%,ShortCut_Main,#1,#2,#3,#4,#5,#6,#7
[S_No_Parameters]
# Fn,..No Parameters..
Set,"#1","%LinkDir%\%ProgramFolder%\%ProgramExe%"
Set,"#2","%Category%\%ProgramTitle%.lnk"
Set,"#3","%LinkDir%\%ProgramFolder%"
Set,"#4","%StartParameters%"
Set,"#5","%Description%"
Set,"#6","%Icon%"
Set,"#7","%OpenWindow%"
System,RefreshVars
Run,%ScriptFile%,ShortCut_Main,#1,#2,#3,#4,#5,#6,#7
[D_Exe_Title]
# Fn,ProgramExe,ProgramTitle
Set,"#9","%LinkDir%\%ProgramFolder%\#1"
System,RefreshVars
Set,"#1","#9"
Set,"#8","!DS\#2.lnk"
System,RefreshVars
Set,"#2","#8"
Set,"#3","%LinkDir%\%ProgramFolder%"
Set,"#4","%StartParameters%"
Set,"#5","%Description%"
Set,"#6","%Icon%"
Set,"#7","%OpenWindow%"
System,RefreshVars
Run,%ScriptFile%,ShortCut_Main,#1,#2,#3,#4,#5,#6,#7
[D_No_Parameters]
# Fn,..No Parameters..
Set,"#1","%LinkDir%\%ProgramFolder%\%ProgramExe%"
Set,"#2","!DS\%ProgramTitle%.lnk"
Set,"#3","%LinkDir%\%ProgramFolder%"
Set,"#4","%StartParameters%"
Set,"#5","%Description%"
Set,"#6","%Icon%"
Set,"#7","%OpenWindow%"
System,RefreshVars
Run,%ScriptFile%,ShortCut_Main,#1,#2,#3,#4,#5,#6,#7
[All_Type_Group]
# Fn,Desktop/StartMenu/QuickLaunch/Autostart,StartMenuGroup
Run,%ScriptFile%,Group_#1,#2
[Group_StartMenu]
# Fn,StartMenuGroup
Set,"#2","#1\%ProgramTitle%.lnk"
System,RefreshVars
Set,"#1","%LinkDir%\%ProgramFolder%\%ProgramExe%"
Set,"#3","%LinkDir%\%ProgramFolder%"
Set,"#4","%StartParameters%"
Set,"#5","%Description%"
Set,"#6","%Icon%"
Set,"#7","%OpenWindow%"
System,RefreshVars
Run,%ScriptFile%,ShortCut_Main,#1,#2,#3,#4,#5,#6,#7
[Group_Desktop]
# Fn,StartMenuGroup
Set,"#1","%LinkDir%\%ProgramFolder%\%ProgramExe%"
Set,"#2","!DS\%ProgramTitle%.lnk"
Set,"#3","%LinkDir%\%ProgramFolder%"
Set,"#4","%StartParameters%"
Set,"#5","%Description%"
Set,"#6","%Icon%"
Set,"#7","%OpenWindow%"
System,RefreshVars
Run,%ScriptFile%,ShortCut_Main,#1,#2,#3,#4,#5,#6,#7
[ShortCut_Main]
Echo,"Adding Shortcuts"
Echo,"What: #1"
Echo,"Where: #2"
Echo,"Working Folder: #3"
Echo,"Characteristics: #4"
Echo,"Description: #5"
Echo,"Icon: #6"
Echo,"Window: #7"[/codebox]