This forced everyone to write new scripts that add the same programs because the build methods are not similar between projects (example: XP PE vs WinPE 2.0) and a lot of work to update them whenever things got improved.
A new discussion topic was created here to discuss a new standard way of creating these application scripts.
This doesn't mean that the script language itself is suffering any modifications, we're merely adding a few script functions that can be shared across projects and this way make scripts work in a more "universal" way and help people quickly write scripts without hassle at all.
So far most hard work has already been completed, but would be good to hear more feedback and requests on this phase while things are still being actively discussed.
Here are some script examples that are valid to be used
CODE
[demo usage]
; Use these examples to see how these commands can be applied inside your app scripts
Add_Shortcut
Add_Shortcut,StartMenu
Add_Shortcut,StartMenu,Games
Add_Shortcut,QuickLaunch
Add_Shortcut,AutoStart
Add_Shortcut,Desktop
require_file,myLibrary.dll
unpack
unpack,AnotherFolder
hive_load,HKU
hive_unload,HKU
reg_add,0x1,"%reg%\Classes\filetype","test","1"
associate_file,html
associate_file,html,open,c:\test.exe
associate_file,html,open,c:\test.exe,/run=%2
associate_file,html,edit
associate_file,html,icon,c:\test.exe
associate_file,html,icon,%systemroot%\System32\Shell32.dll,-153
; Use these examples to see how these commands can be applied inside your app scripts
Add_Shortcut
Add_Shortcut,StartMenu
Add_Shortcut,StartMenu,Games
Add_Shortcut,QuickLaunch
Add_Shortcut,AutoStart
Add_Shortcut,Desktop
require_file,myLibrary.dll
unpack
unpack,AnotherFolder
hive_load,HKU
hive_unload,HKU
reg_add,0x1,"%reg%\Classes\filetype","test","1"
associate_file,html
associate_file,html,open,c:\test.exe
associate_file,html,open,c:\test.exe,/run=%2
associate_file,html,edit
associate_file,html,icon,c:\test.exe
associate_file,html,icon,%systemroot%\System32\Shell32.dll,-153
And a small description:
Add_Shortcut as the name states will add a shortcut - whenever called without any parameters as the first example it will place a shortcut on the start menu (or equivalent shell manager) under the same folder name where the script itself is placed (handy for using other folder names under your language)
If Add_Shortcut uses any of the mentioned parameters it will create the shortcut where specified.
-------------------------
require_file it's a simple wrapper to the CopyOrExpand command and will simply add a file from the source folder if it doesn't already exist on the system folder (system32 in most cases)
-------------------------
unpack will simply extract all files inside the script onto the respective program folder. It uses "Folder" as the default container for these files, or specify another folder to "unpack" as parameter
-------------------------
Hive_Load/Hive_Unload will respectively load and unload common registry hives found on windows OS's (not just mean for PE also able to be applied on other windows installs).
People can use HKU, HCU and HKLM hives.
-------------------------
reg_add uses the same format as commonly found on inf files from both bartPE and windows with the difference that it will be necessary to add the "%reg%\" variable to ensure that all writings are done on a external loaded hive - if we declare "%reg%\" as "" (empty) then all changes are directly applied on the host windows. (handy for installing the application scripts on our own installed windows)
--------------------------
Associate_File as the name states will associate a certain filetype to a specific program - also possible to select the icon using the possible syntax combinations writen above.
So far this function works good for a 1~3 file associations, but if you add >10 filetypes like a tugzip script I've tested - it will take around extra 4 minutes to be complete.. (performance should be worked on this one)
---------------------------------------------------------------------
Using this new method should be fairly easy and most scripts already look as simple as this
CODE
[main]
Title=MiTec Network Meter
Description=This application scans for network interfaces and adapters installed in system.
Level=5
Version=1
Date=2007-JUL-21
Contact=http://www.mitec.cz/netmet.html
Author=Michal Mutl
[variables]
%ProgramTitle%=MiTeC Network Meter
%ProgramEXE%=NetMet.exe
%ProgramFolder%=MiTeC
[process]
Add_Shortcut
unpack
Title=MiTec Network Meter
Description=This application scans for network interfaces and adapters installed in system.
Level=5
Version=1
Date=2007-JUL-21
Contact=http://www.mitec.cz/netmet.html
Author=Michal Mutl
[variables]
%ProgramTitle%=MiTeC Network Meter
%ProgramEXE%=NetMet.exe
%ProgramFolder%=MiTeC
[process]
Add_Shortcut
unpack
The good part is that none of these functions are hardcoded anywhere and it's possible to improve or add more or less as needed. More info and details on our discussion can be followed using the link posted at the top of this page.
With this new scripting style should be possible to share many more scripts across most projects, including bartpeCore, liveXP and VistaPE and the next ones to come since they are not depending on any single project.
A few scripts were already posted and can be used as example, look here.
And a small tutorial showing how to create these newer scripts using wb can be found here.