Jump to content











Photo
* * * * * 1 votes

App scripts


  • Please log in to reply
659 replies to this topic

#26 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 30 July 2007 - 06:44 AM

Ok i've understand
But not so easy to find all need variables :yahoo: , can someone help for complete this ?
[codebox][Variables] %ProjectName%=VistaPE %RegSoftware%=%TargetDir%\windows\system32\config\software %RegSystem%=%TargetDir%\windows\system32\config\system %RegUser%=%TargetDir%\windows\system32\config\default %RegDefault%=%TargetDir%\windows\system32\config\default %ES%=%TargetDir%\windows\system32\shortcut.inf %VistaInfo%=%ProjectDir%\script.project %BootSRC%=%BaseDir%\Temp\VistaPE\BootWimSrc %InstallSRC%=%BaseDir%\Temp\VistaPE\InstallWimSrc -------------------------------------------------------------------For BuildModel in VistaPE %ProjectName%=VistaPE %ProjectTemp%=%BaseDir%\Temp\%ProjectName% %shcTemp%=%ProjectTemp%\shcTemp.ini %BuildModelScript%=%ProjectDir%\Build\Standard-4-BuildModel.Script %ActiveShell%=%ProjectDir%\Tools\Shortcut.script -----------------------------------------------------------------------For Api.script in VistaPE %api%=%projectdir%\Build\api.script %source_win%= ??? %target_win%=%TargetDir%\windows %source_sys%= ??? %target_sys%=%TargetDir%\windows\System32 %HIVE_HKLM%=%targetDir%\I386\System32\setupreg.hiv <--- = %RegSystem% ??? %HIVE_HKCU%=%TargetDir%\i386\System32\Config\default <--- = %RegDefault% %HIVE_HKU%=%targetDir%\I386\System32\Config\software <--- = %RegSoftware% %HIVE_BASE%=HKLM <--- = ??? %reg_temp%=wb-hive <--- = ??? %reg%\=%reg_temp%\ <--- = ??? %Parameters%= %IconFile%= %IconIndex%= %StartMode%= %shortcut_IconFile%= %shortcut_Parameters%= %shortcut_Show%= hive_load=run,%api%,reg_hiveload hive_unload=run,%api%,reg_hiveunload reg_add=RegWrite,"%HIVE_BASE%" associate_file=run,%api%,do_associate Add_Shortcut=Run,%api%,AddShortcut
Require_File=run,%api%,expand_file
Unpack=Run,%api%,depack
process_log=Run,%ScriptLog%,Process-log
[/codebox]

#27 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10544 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 30 July 2007 - 08:33 AM

Ok i've understand
But not so easy to find all need variables :yahoo: , can someone help for complete this ?

[Variables]...%source_win%= Where the Windows Source folder is placed%target_win%=%TargetDir%\windows%source_sys%= Where the Windows Source folder is placed (the place from where to find needed files on the copy&expand script)%target_sys%=%TargetDir%\windows\System32%HIVE_HKLM%=%targetDir%\I386\System32\setupreg.hiv       <--- = %RegSystem%  ???%HIVE_HKCU%=%TargetDir%\i386\System32\Config\default      <--- = %RegDefault%%HIVE_HKU%=%targetDir%\I386\System32\Config\software      <--- = %RegSoftware%%HIVE_BASE%=HKLM      <--- = ???%reg_temp%=wb-hive      <--- = ???%reg%\=%reg_temp%\      <--- = ???

%HIVE_BASE% => The HKEY which is used as base to load external hives%reg_temp% => the name of section that holds the loaded hive%reg%\ => it's a variable mostly used for reg_add. It was added as a small trick - when we set this variable value to empty then it will write the registry keys directly on the Windows where it is running - handy for installing scripts on the running windows.These are all values that also remain valid for VistaPE - but you will need to match the locations for VistaPE hives inside the Windows\System32\Config folder (%HIVE_HKLM%,%HIVE_HKU%,%HIVE_HKCM%) - not sure if all can be found, but there should exist some hive to hold this info.Look inside the script.project file from livexp to read this small guide:

[Quick_Guide_for_API]--- [ Variables ] -----%api% is the script that contains all api related functions%source_win%=Where the Windows Source folder is placed%target_win%=Windows Target Folder%source_sys%=Using Windows XP Install files it's the same as %source_win%,when source is an Installed windows it's likely System32%target_sys%=In most cases %target_win%\System32(can have other names for x64 OS's)%HKLM%,%HKCU%=used when writing registry keys on target--- [ Functions ] -------> Add_Shortcut -> add a shortcut, next parameter defines where- autorun -> start with windows (e.g. Add_Shortcut,autorun)- desktop -> place on the desktop (e.g. Add_Shortcut,Desktop)- startmenu -> place on the start menu (e.g. Add_Shortcut,StartMenu)-> Add another parameter and it will be placed inside afolder on start menu (e.g. Add_Shortcut,StartMenu,Games)--> Require -> will check if a system file is present and extract if needed (e.g. require,msjava.dll)--> Unpack -> will extract all files inside the scriptif no parameters are specified will extract from "Folder" (e.g. Unpack)
if a parameter is given, will extract from given folder name
(e.g. Unpack,AnotherFolder)


:)

#28 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 03 August 2007 - 09:55 AM

Hi, Nuno
Weather become good now :yahoo: , so I'm a little busy in my field for making harvest.
I've all working with VistaPE 8 do I adapte it for VistaPE 9 ? (Because there is an api in it, if yes I must modify it)
I will post soon these api , I must make more test.

#29 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 07 August 2007 - 10:23 PM

Hi all,
The new api for VistaPe and LiveXP is here
Test and give your comment

#30 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 08 August 2007 - 03:11 AM

Hi all,
The new api for VistaPe and LiveXP is here
Test and give your comment


I have had a look but not tested.

One question: How did the functions for adding shortcuts get so out of hand? Historical and political reasons? :yahoo:
Is it possible to have all the confusing variations -"Add_Shortcuts,#1,#2", "Add_Shortcuts_Desktop", etc, etc - all
lead to one function like "Shortcuts_Main" with the option to use all available shortcut parameters (five or six, I think).

On a broader note, I would like to see the User Variables being set from the Interface with Text Boxes rather than typed into the Script.
Would that be a good idea?

#31 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12702 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 08 August 2007 - 08:05 AM

Hi all,
The new api for VistaPe and LiveXP is here
Test and give your comment

I do not understand why the shortcut handling of VistaPE is so different from that of nativeEx.

In both cases a 'shortcut description' can be generated like this one:
&#91;Created&#93;

 Program=shortcutParse

 Version=1.1.0

 Copyright=&#40;C&#41; 2007 Peter Schlang

 Date=2007-Aug-07 163733328

 &#91;Shortcut&#93;

 targetDir=C&#58;\Dokumente und Einstellungen\Peter\Desktop\WB Archiv\Beta8\Target\nativeEx

 shortCutName=OffByOne

 shortCutType=ST

 shortCutLocation=

 shortCutExe=%SystemDrive%\Programme\OffByOne\OB1.exe

 shortCutToolTip=

 shortCutParameters=

 shortCutShow=

 shortCutDir=%SystemDrive%\Programme\OffByOne

 shortCutHotKey=

 shortCutIconFile=

 shortCutIcon=0
The difference is that nativeEx's shortcutWinExp.exe generates the shortcuts at build time, while in VistaPE it could be done on starting of the explorer.

So the only API difference could be:
  • nativeEx: store anywhere and start shortcutWinExp
  • VistaPE: store anywhere else and store a batch to start shortcutWinExp
Peter

#32 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 08 August 2007 - 09:32 AM

I have had a look but not tested.

One question: How did the functions for adding shortcuts get so out of hand? Historical and political reasons? :yahoo:
Is it possible to have all the confusing variations -"Add_Shortcuts,#1,#2", "Add_Shortcuts_Desktop", etc, etc - all
lead to one function like "Shortcuts_Main" with the option to use all available shortcut parameters (five or six, I think).

On a broader note, I would like to see the User Variables being set from the Interface with Text Boxes rather than typed into the Script.
Would that be a good idea?

There is a lot of Function for shortcut because i have include the api from VistaPE 9 for compatibility
So you can use the syntax of VistaPE 9 the only difference is you must add RunFromRam,%pCheckBox1% .

We can only, (I think) use four parameters with Function ,that's why i set some value in section Variable.

It's possible to add something in interface but the concept of Nuno is to make simple
so I think i did not want any things in Interface
No need of special generator of script like MakeScript

One things can be add if you want an Interface
Like the function RunFromRam
RunFromRam,True ---> No need nothing in Interface
RunFromRam,%pCheckBox1% ---> Need you add a CheckBox in Interface
Why not make same for Shortcut ?
Add_Shortcut,Desktop,,%My_CheckBox%

For the parameters in Variables section you can also use them in Interface
but keep same name

#33 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10544 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 08 August 2007 - 03:08 PM

Great work, but I admit that the shortcut creation gets really fuzzy this way - haven't had much time left to test but the api was meant to be independent from script.project since the beginning or we'll be merging too many difference settings altogether and then it will be much harder to understand and split them when trying to port to another platform/project..

On wb072 you can add up to 9 parameters when running another section and should also care to support other shells like xoblite and bblean otherwise won't it complicate too much when using exclusively the waik? :)

Using interface is valid for vistaPE but this api should aim (at first) to support minimal functions which work independently of project or target windows.


Simple commands, stable results.. :yahoo:

#34 phox

phox

    Silver Member

  • .script developer
  • 764 posts

Posted 08 August 2007 - 04:24 PM

Simple commands, stable results.. :yahoo:


I don't know what you are talking about,
but I do know that the virtue is to:

#35 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12702 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 08 August 2007 - 04:36 PM

I don't know what you are talking about,
but I do know that the virtue is to:


@Phox:
Allow me this remark as a friend:
Sometimes I have the opinion that you should add to your 'Four S' a fifth character:
'E' for efficiency :yahoo:

BTW: The 'efficiency' is more meant as an reply to Nuno's reply :)

Peter

#36 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 08 August 2007 - 05:46 PM

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. :yahoo:

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&#39;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]

#37 phox

phox

    Silver Member

  • .script developer
  • 764 posts

Posted 08 August 2007 - 06:15 PM

@Phox:
Allow me this remark as a friend:
Sometimes I have the opinion that you should add to your 'Four S' a fifth character:
'E' for efficiency :)

BTW: The 'efficiency' is more meant as an reply to Nuno's reply :)

Peter



Thank you my friend!

I really appreciate your work and contribution
to development of WinBuilder. On my list you are No 2. :)

Just remember that some Forum members (like me) are ordinary mortals,
pretending to know something about computers.

In the past year I have learned a lot, but as time progress, WinBuilder is
more and more mystified for me instead more understandable.

I appeal to you and all script developers: Have a mercy!!! :yahoo:
Make the projects structure and scripts simpler, not more complex!

#38 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12702 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 08 August 2007 - 06:20 PM

In the past year I have learned a lot, but as time progress, WinBuilder is more and more mystified for me instead more understandable.
...
Make the projects structure and scripts simpler, not more complex!

For the first item, I have a similar feeling. :yahoo:
That's my reason for the 'E(ffiiency)' suggestion. (And the hint, that the post is meant more for Nuno than for you)
For the second item, I think I'm always trying to suggest solutions which follow your demand. (see my post #31 in this topic)

Peter

#39 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 09 August 2007 - 07:32 AM

I do not understand why the shortcut handling of VistaPE is so different from that of nativeEx.

In both cases a 'shortcut description' can be generated like this one:

&#91;Created&#93;

 Program=shortcutParse

 Version=1.1.0

 Copyright=&#40;C&#41; 2007 Peter Schlang

 Date=2007-Aug-07 163733328

 &#91;Shortcut&#93;

 targetDir=C&#58;\Dokumente und Einstellungen\Peter\Desktop\WB Archiv\Beta8\Target\nativeEx

 shortCutName=OffByOne

 shortCutType=ST

 shortCutLocation=

 shortCutExe=%SystemDrive%\Programme\OffByOne\OB1.exe

 shortCutToolTip=

 shortCutParameters=

 shortCutShow=

 shortCutDir=%SystemDrive%\Programme\OffByOne

 shortCutHotKey=

 shortCutIconFile=

 shortCutIcon=0
The difference is that nativeEx's shortcutWinExp.exe generates the shortcuts at build time, while in VistaPE it could be done on starting of the explorer.

So the only API difference could be:
  • nativeEx: store anywhere and start shortcutWinExp
  • VistaPE: store anywhere else and store a batch to start shortcutWinExp
Peter


Peter,

That sounds excellent. However, my understanding is that Scripts were written with commands ranging from "AddShortcut" to "Add_Shortcut_Startmenu,MenuGroup". So the first has no arguments/parameters, while second has it's first argument/parameter as the Startmenu SubGroup.
How to get all these Scripts compatible with VistaPE. Maybe, I'm on the wrong track.

For each Shortcut created, a line is added to the file "shortcut.inf" in the order: "what, where, working folder, characteristics, description, icon, characteristics of window (normal|min|max". So some of the arguments/parameters for the Shortcut Commands in various Scripts need rearranging. Unfortunately, the function of adding Shortcuts seems to have gotten out of hand, and I can only guess what arguments/parameters might have been used for each of the Command permutations.

What is the command that calls you [Shortcut] Section? Does it have arguments/parameters? If I ran the Script in VistaPE, would a proper Shortcut be created? Do you have a sample Script from nativeEx that is Vista compatible, that I can try in VistaPE?

#40 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10544 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 09 August 2007 - 09:51 AM

The current API has a simple structure as is - adding too many features just makes everything too complicated.. :yahoo:

Writing this line of code inside a script
Add_Shortcut

Adds a shortcut on the start menu using the same folder name from where the script is found (for example: File Recovery, etc..)

---------

No complications, no long lists of endless options - just create a shortcut.. :)

---------

I'm uploading a new liveXP project to demonstrate how simple this gets (even for particular cases..)

:)

#41 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 09 August 2007 - 01:29 PM

The current API has a simple structure as is - adding too many features just makes everything too complicated.. :)


Hi Nuno,

Where ya been? :yahoo:

OK. We've tried the new API with VistaPE-BETA v.009, 22.06.2007. It doesn't support RunFromRam because the target of the Shortcut must be on the CD.

!PDC\%ProgramFolder%\%ProgramEXE%#$c!DS\%ProgramTitle%.lnk","Append"If,#1,Equal,Desktop,TXTAddLine,%ES%,"!PDC\%ProgramFolder%\%ProgramEXE%#$c!DS\%ProgramTitle%.lnk","Append"If,#1,Equal,StartMenu,TXTAddLine,%ES%,"!PDC\%ProgramFolder%\%ProgramEXE%#$c#2\%ProgramTitle%.lnk","Append"If,#1,Equal,QuickLaunch,Echo,"Quick Launch shortcut not supported yet."If,#1,Equal,AutoStart,TXTAddLine,%AutoRunFile%,"1|s|%ProgramTitle%|s|#$q!PDC\%ProgramFolder%#$q|s|%ProgramEXE%|s|","Append" _linenums:0'>Add_Shortcut=Run,%API%,AddShortcut...[AddShortcut]If,#1,Equal,,TXTAddLine,%ES%,"!PDC\%ProgramFolder%\%ProgramEXE%#$c!DS\%ProgramTitle%.lnk","Append"If,#1,Equal,Desktop,TXTAddLine,%ES%,"!PDC\%ProgramFolder%\%ProgramEXE%#$c!DS\%ProgramTitle%.lnk","Append"If,#1,Equal,StartMenu,TXTAddLine,%ES%,"!PDC\%ProgramFolder%\%ProgramEXE%#$c#2\%ProgramTitle%.lnk","Append"If,#1,Equal,QuickLaunch,Echo,"Quick Launch shortcut not supported yet."If,#1,Equal,AutoStart,TXTAddLine,%AutoRunFile%,"1|s|%ProgramTitle%|s|#$q!PDC\%ProgramFolder%#$q|s|%ProgramEXE%|s|","Append"
It also only supports two parameters: Shortcut Type and StartMenu Group/Category.As you know, pedrole15 has addressed the incompatabilities with:
Set,"%My_LinkDrive%","#$pSystemDrive#$p\Program#$sFiles"System,RefreshVars...[AddShortcut]echo,"Creating a new shortcut for %programTitle%.. [%programFolder%\%programExe%]"Run,%API%,AddShortcut_#1,#2...[AddShortcut_Desktop]If,%Icon%,NotEqual,"",Set,"%My_Icon%","%My_LinkDrive%\%programFolder%\%Icon%"System,RefreshVarsTXTAddLine,%ES%,"%My_LinkDrive%\%programFolder%\%programExe%#$c!DS\%ProgramTitle%.lnk#$c[... etc] _linenums:0'>Add_Shortcut=Run,%API%,AddShortcut...[RunFrom_Ram]Set,%My_CheckBox%,#1System,RefreshVarsIf,%My_CheckBox%,Equal,True,Set,"%My_ProgramFiles%","Program#$sFiles"If,%My_CheckBox%,Equal,True,Set,"%My_LinkDrive%","#$pSystemDrive#$p\Program#$sFiles"System,RefreshVars...[AddShortcut]echo,"Creating a new shortcut for %programTitle%.. [%programFolder%\%programExe%]"Run,%API%,AddShortcut_#1,#2...[AddShortcut_Desktop]If,%Icon%,NotEqual,"",Set,"%My_Icon%","%My_LinkDrive%\%programFolder%\%Icon%"System,RefreshVarsTXTAddLine,%ES%,"%My_LinkDrive%\%programFolder%\%programExe%#$c!DS\%ProgramTitle%.lnk#$c[... etc]
Great work! And your straightforward "Add_Shortcuts" will be compatible with RunFromRAM in the next official release.But what is the need for compatibility with all the mutant Shortcut functions? It certainly makes a mess of the code. I haven't even started to try and make sense of the unpack/depack permutations.One other thing about the straightforward approach. It is sometimes necessary to run a Program from its own environment. I'm talking about the "working folder" parameter #3; also seen as the "Start in: ..." property in Explorer's Shortcut Properties Box. See this discussion where a Product Key didn't function unless the Shortcut started the Program in the Program's directory.

pedrole15's API accommodates the full range of parameters (seven) for the "Add_Shortcut" command. The other variations of the Shortcut Function only support two or three. I assume that is how those functions were originally specified.

In my opinion the full range of parameters should be allowed (for use when required) and documented.

#42 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10544 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 09 August 2007 - 01:48 PM

Hi Allan!

I'm on vacances and returned home for a few days, next saturday will meet another island (Terceira) here in Azores - but really wanted to help a bit.. :)


Your contribution to vistaPE is also looking good - just wish I had more time to help you testing these functions on vistaPE.

-----------

Also agree that parameters and examples should be documented - mostly to define a standard way how they should expect to behave or to help people learn what can be done with them.

There is a brief documentation page here: http://www.boot-land...pplication.html - but a lot has been changed over these last months.

----------

The solutions from Pedrole15 are very good as well - I see he's trying to add an option for those scripts already created for VistaPE to run in RAM or from CD but this still seems a very project specific vistaPE feature because of the interface dependency.

I also stumbled on a few programs that will only run from writable media so it would be good to see a good solution for this matter, wish I had more ideas on it could be solved but I'm sure Pedro already has some good expertise on this area.

:yahoo:

#43 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 09 August 2007 - 02:27 PM

Hi allanf
Have a look in my signature you will find the 3 funtions for VistaPE an liveXP
Each in a single file , that will make much easy to understand :yahoo:

#44 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 09 August 2007 - 03:56 PM

Hi allanf
Have a look in my signature you will find the 3 funtions for VistaPE an liveXP
Each in a single file , that will make much easy to understand :)


Hi pedrole15,

Now I understand.

To me the New API worked well, but looked bad ... confusing to read, because of the mix of different styles of contributers/developers. It is much easier to read your contribution when extracted from the whole. One can appreciate a more cavalier style.

:yahoo:



:) :) :)




Thanks. :)

#45 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 12 August 2007 - 03:49 PM

Hi,allanf
I agree with you that my code look bad but it is faster (like the horse :loleverybody: :w00t: )
Make a test with this:
[codebox][main]Title=CodeBox testDescription=Running custom commands[variables]%My_Color%=Yellow[process]run,%ScriptFile%,Func,"1"//run,%ScriptFile%,MyFunc,"1"//Message,"My color is : %My_Color%",Information[Func]If,#1,Equal,"1",Set,"%My_Color%","Black"If,#1,Equal,"2",Set,"%My_Color%","White"If,#1,Equal,"3",Set,"%My_color%","Blue"If,#1,Equal,"4",Set,"%My_Color%","Red"If,#1,Equal,"11",Set,"%My_color%","Black_Light"If,#1,Equal,"12",Set,"%My_Color%","White_Light"If,#1,Equal,"13",Set,"%My_Color%","Blue_Light"If,#1,Equal,"14",Set,"%My_Color%","Red_Light"System,RefreshVars[MyFunc]run,%ScriptFile%,MyFunc_#1[MyFunc_]Set,"%My_Color%","Not assigned"System,RefreshVars[MyFunc_1]Set,"%My_Color%","Black"System,RefreshVars[MyFunc_2]Set,"%My_Color%","White"System,RefreshVars[MyFunc_3]Set,"%My_color%","Blue"System,RefreshVars[MyFunc_4]Set,"%My_Color%","Red"System,RefreshVars[MyFunc_11]Set,"%My_color%","Black Light"System,RefreshVars[MyFunc_12]Set,"%My_Color%","White Light"System,RefreshVars[MyFunc_13]Set,"%My_Color%","Blue Light"[MyFunc_14]Set,"%My_Color%","Red Light"[/codebox]My bad code is allways faster[quote]As you know, pedrole15 has addressed the incompatabilities with:[RunFrom_Ram]If,#1,Equal,True,Set,"%My_ProgramFiles%","Program#$sFiles"If,#1,Equal,True,Set,"%My_LinkDrive%","#$pSystemDrive#$p\Program#$sFiles"System,RefreshVars[/quote]I'm not sure i've make errorIt can be like this:[codebox][AddShortcut]If,#1,Equal,,TXTAddLine,%ES%,"%My_InfCmd%\%ProgramFolder%\%ProgramEXE%#$c!DS\%ProgramTitle%.lnk#$c%My_InfCmd%\%ProgramFolder%","Append"If,#1,Equal,Desktop,TXTAddLine,%ES%,"%My_InfCmd%\%ProgramFolder%\%ProgramEXE%#$c!DS\%ProgramTitle%.lnk#$c%My_InfCmd%\%ProgramFolder%","Append"If,#1,Equal,StartMenu,TXTAddLine,%ES%,"%My_InfCmd%\%ProgramFolder%\%ProgramEXE%#$c#2\%ProgramTitle%.lnk#$c%My_InfCmd%\%ProgramFolder%","Append"If,#1,Equal,QuickLaunch,Echo,"Quick Launch shortcut not supported yet."If,#1,Equal,AutoStart,TXTAddLine,%AutoRunFile%,"1|s|%ProgramTitle%|s|#$q%My_LinkDrive%\%programFolder%#$q|s|%ProgramEXE%|s|","Append"[depack]If,#1,Equal,,Set,"%folder_name%","Folder"If,#1,NotEqual,,Set,"%folder_name%","#1"DirMake,"%targetDir%\%My_ProgramFiles%"DirMake,"%targetDir%\%My_ProgramFiles%\%ProgramFolder%"ExtractAllFiles,"%ScriptFile%","%folder_name%","%targetDir%\%My_ProgramFiles%\%ProgramFolder%"[/codebox]But for me the problem is "!PDC" command When you make you program "Run from CD"You never have the icon showed Why ?But work when "Run from Ram"I remark that when use [code]TXTAddLine,%ES%,&#34;!PDC\%OutDir%\%Executable%#$c%Category%\%ProgramName%.lnk#$c!PDC\%OutDir%&#34;,&#34;Append&#34;[/code] The program is on E:\ProgramBut if use like precedent version[code]TXTAddLine,%ES%,&#34;Y&#58;\%OutDir%\%Executable%#$c%Category%\%ProgramName%.lnk#$cY&#58;\%OutDir%&#34;,&#34;Append&#34;[/code]
It is working
So if can make the "!PDC" command to point on y: rather e:

But perhaps it is working for other language than French
if you see sceenshoot posted by Haiphong there is no icon

#46 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 12 August 2007 - 05:46 PM

Hi pedrole15,

Strange that it works with "y:", but not working with "!PDC". :loleverybody:

ATM, I cannot test. Perhaps it is necessary to specify the icon in "shortcut.inf"... parameter #6. Something like this for the code box.

&#91;main&#93;

Title=CodeBox VistaPE Shortcut Test



&#91;Variables&#93;

%LinkDir%=MyLinkDirectory

%ProgramFolder%=MyProgramFolder

%ProgramExe%=MyProgramExecutable

%ProgramTitle%=MyProgramTitle

%Category%=MyStartMenuCategory

%StartParameters%=MyProgramParameters

%Description%=MyProgramDescription

%Icon%=MyProgramIconPath

%OpenWindow%=MyProgramWindow

Add_Shortcut=Run,%ScriptFile%,Type_Group



&#91;Process&#93;



########## UnComment One From Below ###########

Run,%ScriptFile%,RunFromCD_Standard

#Run,%ScriptFile%,RunFromCD_Custom

#Run,%ScriptFile%,RunFromRAM

########## UnComment One From Below ###########

#Add_Shortcut,StartMenu,%Category%

Add_Shortcut,Desktop



&#91;RunFromCD_Standard&#93;

Set,%LinkDir%,&#34;!PDC&#34;



&#91;RunFromCD_Custom&#93;

Set,%LinkDir%,&#34;!CD&#34;



&#91;RunFromRAM&#93;

Set,%LinkDir%,&#34;!PF&#34;



&#91;Type_Group&#93;

Run,%ScriptFile%,Group_#1,#2



&#91;Group_StartMenu&#93;

Set,&#34;#2&#34;,&#34;#1\%ProgramTitle%.lnk&#34;

System,RefreshVars

Set,&#34;#1&#34;,&#34;%LinkDir%\%ProgramFolder%\%ProgramExe%&#34;

Set,&#34;#3&#34;,&#34;%LinkDir%\%ProgramFolder%&#34;

Set,&#34;#4&#34;,&#34;%StartParameters%&#34;

Set,&#34;#5&#34;,&#34;%Description%&#34;

Set,&#34;#6&#34;,&#34;%LinkDir%\%ProgramFolder%\%ProgramExe%&#34;

Set,&#34;#7&#34;,&#34;%OpenWindow%&#34;

System,RefreshVars

Run,%ScriptFile%,ShortCut_Main,#1,#2,#3,#4,#5,#6,#7



&#91;Group_Desktop&#93;

Set,&#34;#1&#34;,&#34;%LinkDir%\%ProgramFolder%\%ProgramExe%&#34;

Set,&#34;#2&#34;,&#34;!DS\%ProgramTitle%.lnk&#34;

Set,&#34;#3&#34;,&#34;%LinkDir%\%ProgramFolder%&#34;

Set,&#34;#4&#34;,&#34;%StartParameters%&#34;

Set,&#34;#5&#34;,&#34;%Description%&#34;

Set,&#34;#6&#34;,&#34;%LinkDir%\%ProgramFolder%\%ProgramExe%&#34;

Set,&#34;#7&#34;,&#34;%OpenWindow%&#34;

System,RefreshVars

Run,%ScriptFile%,ShortCut_Main,#1,#2,#3,#4,#5,#6,#7



&#91;ShortCut_Main&#93;

Echo,&#34;Shortcut Info...&#34;

Echo,&#34;What&#58; #1&#34;

Echo,&#34;Where&#58; #2&#34;

Echo,&#34;Working Folder&#58; #3&#34;

Echo,&#34;Characteristics&#58; #4&#34;

Echo,&#34;Description&#58; #5&#34;

Echo,&#34;Icon&#58; #6&#34;

Echo,&#34;Window&#58; #7&#34;


#47 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 12 August 2007 - 10:46 PM

Perhaps it is necessary to specify the icon .

Ok you are right, I have found the error
In Script.project for VistaPe Beta
[Shortcut_Start_Menu]#RAMIf,%pCheckBox1%,Equal,true,TXTAddLine,%ES%,"!PF\%OutDir%\%Executable%#$c%Category%\%ProgramName%.lnk#$c!PF\%OutDir%#$c%StartParameters%#$c%Description%#$c!PF\%OutDir%\%Icon%#$c%OpenWindow%","Append"#CDIf,%pCheckBox1%,Equal,false,TXTAddLine,%ES%,"!PDC\%OutDir%\%Executable%#$c%Category%\%ProgramName%.lnk#$c!PDC\%OutDir%#$c%StartParameters%#$c%Description%#$c!PDC\%OutDir%\%Icon%#$c%OpenWindow%","Append"[Shortcut_Desktop]#RAMIf,%pCheckBox1%,Equal,true,TXTAddLine,%ES%,"!PF\%OutDir%\%Executable%#$c!DS\%ProgramName%.lnk#$c!PF\%OutDir%#$c%StartParameters%#$c%Description%#$c!PF\%OutDir%\%Icon%#$c%OpenWindow%","Append"#CDIf,%pCheckBox1%,Equal,false,TXTAddLine,%ES%,"!PDC\%OutDir%\%Executable%#$c!DS\%ProgramName%.lnk#$c!PDC\%OutDir%#$c%StartParameters%#$c%Description%#$c!PDC\%OutDir%\%Icon%#$c%OpenWindow%","Append"
must be
[Shortcut_Start_Menu]If,%Icon%,Equal,"",Set,%Icon%,%Executable%System,RefreshVars#RAMIf,%pCheckBox1%,Equal,true,TXTAddLine,%ES%,"!PF\%OutDir%\%Executable%#$c%Category%\%ProgramName%.lnk#$c!PF\%OutDir%#$c%StartParameters%#$c%Description%#$c!PF\%OutDir%\%Icon%#$c%OpenWindow%","Append"#CDIf,%pCheckBox1%,Equal,false,TXTAddLine,%ES%,"!PDC\%OutDir%\%Executable%#$c%Category%\%ProgramName%.lnk#$c!PDC\%OutDir%#$c%StartParameters%#$c%Description%#$c!PDC\%OutDir%\%Icon%#$c%OpenWindow%","Append"[Shortcut_Desktop]If,%Icon%,Equal,"",Set,%Icon%,%Executable%System,RefreshVars#RAMIf,%pCheckBox1%,Equal,true,TXTAddLine,%ES%,"!PF\%OutDir%\%Executable%#$c!DS\%ProgramName%.lnk#$c!PF\%OutDir%#$c%StartParameters%#$c%Description%#$c!PF\%OutDir%\%Icon%#$c%OpenWindow%","Append"#CDIf,%pCheckBox1%,Equal,false,TXTAddLine,%ES%,"!PDC\%OutDir%\%Executable%#$c!DS\%ProgramName%.lnk#$c!PDC\%OutDir%#$c%StartParameters%#$c%Description%#$c!PDC\%OutDir%\%Icon%#$c%OpenWindow%","Append"


#48 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 13 August 2007 - 02:13 AM

I have a couple of issues with the creation of start menu shortcuts with the api in its current form. The example:

[variables]
%ProgramTitle%=My Program
%ProgramEXE%=myprogram.exe
%ProgramFolder%=My Program

1. With the current api, a shortcut cannot be placed in the root of the programs folder in the start menu. Add_Shortcut,StartMenu would place the shortcut in the folder from which the script is run, eg 'Productivity'. Hence I suggest the adding of a fixed arguement if such a shortcut is desired. Something like: Add_Shortcut,StartMenu,StartMenu or Add_Shortcut,StartMenu,StartMenuRoot.

2. A second related issue is that if a folder name is specified -- eg Add_Shortcut,StartMenu,%ProgramFolder% -- this folder cannot be placed in the 'Productivity' folder unless this is explicitly specified as such: Add_Shortcut,StartMenu,Productivity\%ProgramFolder%. But what if someone wants to place the script in a folder with a different name? They're stuck with the naming unless they edit the script. Add_Shortcut,StartMenu,%Scriptdir%\%ProgramFolder% does not work (obviously), but possibly something of the sort should be allowed?

Regards,
Galapo.

#49 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 13 August 2007 - 06:04 AM

I've been having trouble assigning program parameters to start menu shortcuts using the api script of LiveXP.

To get it to work properly I changed the line
If,%shortcut_type%,Equal,SM,Run,%BuildModelScript%,Add-Shortcut,&#34;%shortcut_type%\#2&#34;,&#34;%My_Shortcut_EXE%#4&#34;,&#34;%ProgramTitle%&#34;,&#34;-SW&#58;%My_Shortcut_FOLDER%&#34;
to
If,%shortcut_type%,Equal,SM,Run,%BuildModelScript%,Add-Shortcut,&#34;%shortcut_type%\#2&#34;,&#34;%My_Shortcut_EXE%&#34;,&#34;%ProgramTitle%&#34;,&#34;-SW&#58;%My_Shortcut_FOLDER%&#34;,&#34;/SP&#58;#4&#34;

Works fine with the change.

Regards,
Galapo.

#50 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 13 August 2007 - 06:41 AM

Hi,Galapo
Right for correct the error but like this:
If,%shortcut_type%,Equal,SM,Run,%BuildModelScript%,Add-Shortcut,&#34;%shortcut_type%\#2&#34;,&#34;%My_Shortcut_EXE%&#34;,&#34;%ProgramTitle%&#34;,&#34;-SW&#58;%My_Shortcut_FOLDER%#4&#34;
and #4 could be and must be write like this
For giving parameters : "#$q#$s#$q-SP:%StartParameters%"
For changing icon :"#$q#$s#$q-SF:#$pProgramFiles#$p\%programFolder%\%Icon%#$q#$s#$q-SI:0"
For starting mode "#$q#$s#$q-SS:SW_SHOWMAXIMIZED"

:loleverybody:




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users