Jump to content











Photo
- - - - -

vista scripts to livexp / file associations


  • Please log in to reply
13 replies to this topic

#1 billonious

billonious

    Silver Member

  • .script developer
  • 528 posts
  • Location:greezeland
  • Interests:curiosity

Posted 22 July 2007 - 03:06 PM

hey, i put two questions in one topic for shortness

1. given that there are lots of scripts for vista but limited ones for livexp, i wonder if there is an easy way to convert them from the former to the latter.

2. what is the basic script to make file associations manually? to be more clear: i made an irfanview script with "makescript" application (made by pedro le 15), but the inner file-association command does not work in winbuilder 070. I have to write manually the specific commands inside the irfanview script and i don't want any interface interaction. just a simple command to associate bmp/jpg/gif and some more formats. I tried to decipher the 7zip script to get the file-associate command but the interface commands confuse me.

#2 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10557 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 22 July 2007 - 04:10 PM

We're already discussing this for some time - maybe you could join our group for testing and improving the way how things are done.

At the moment liveXP is using some a template that makes scripts portable - still a bit limited on the scope of actions allowed, but should give you scripts that work across projects.

Look on this download section: http://www.boot-land...p;showdlforum=7

Download any script and look how it's coded - hopefully we should bring this functionality to vistaPE and also add the file association (still missing a definitive way to write registry keys under all projects)


-------------


You can also take a look on how other scripts written specifically for liveXP do associations - look inside opera or offbyone browsers scripts for examples..

:yahoo:

#3 billonious

billonious

    Silver Member

  • .script developer
  • 528 posts
  • Location:greezeland
  • Interests:curiosity

Posted 22 July 2007 - 04:56 PM

[FilesAssociations]
RegHiveLoad,"Tmp_software","%TargetDir%\i386\system32\config\software"
RegWrite,"HKLM",0x1,"Tmp_software\Classes\.BMP","","IrfanView.BMP"
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP Files","","IrfanView BMP Files"
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP Files\DefaultIcon","","#$pSystemDrive#$p\%WorkDir%\IrfanView\i_view32.exe"
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP Files\shell","","
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP Files\shell\open","","
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP Files\shell\open\command","","#$q#$pSystemDrive#$p\%WorkDir%\IrfanView\i_view32.exe#$q#$s#$q%1#$q"


Hey nuno,
i took the code above from irfanview script regarding file associations (specifically for bmp). but it doesn't work. Similar code doesn't work for other applications too. Is there any modification to do?

#4 pscEx

pscEx

    Platinum Member

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

Posted 22 July 2007 - 05:00 PM

just a simple command to associate bmp/jpg/gif and some more formats.

Generally the 'associate' has two minimum steps:
  • define a symbolic link for the extention
    (several extentions, e.g. .htm, .html, .xml can have the same link)
  • in the link target, define an 'Open' command.
Now in .script language (you must replace the <???> items by reasonable values of your choice):
  • Open the software hive:
    RegHiveLoad,&#34;WB-Software&#34;,&#34;%TargetDir%\i386\system32\config\software&#34;
  • define the link:
    RegWrite,&#34;HKLM&#34;,0x1,&#34;WB-Software\Classes\.<myExtention>&#34;,,&#34;<myLink>&#34;
  • define the link target:
    RegWrite,&#34;HKLM&#34;,0x2,&#34;WB-Software\Classes\<myLink>\shell\open\command&#34;,,&#34;<OpenWithMyProgram>&#34;
    • optionally define an icon:
      RegWrite,HKLM,0x1,&#34;WB-Software\Classes\<myLink>\DefaultIcon&#34;,&#34;&#34;,&#34;<file name>#$c<icon number>&#34;
    • optionally define context title:
      RegWrite,HKLM,0x1,&#34;WB-Software\Classes\<myLink>\Shell\Open&#34;,&#34;&#34;,&#34;<context text>&#34;
  • Close the software hive:
    RegHiveUnLoad,&#34;WB-Software&#34;
<OpenWithMyProgram> is very program specific.
Samples:
  • For notepad:"%SystemRoot%\system32\NOTEPAD.EXE %1"
  • For OB1: "#$q%PE_Programs%\OffByOne\OB1.exe#$q #$qfile:///%1#$q"
  • For ImDisk: "rundll32.exe#$simdisk.cpl#$cRunDLL_MountFile#$s%1"
For more information, do as Nuno already said: Compare with existing scripts.

Good luck!

Peter

#5 billonious

billonious

    Silver Member

  • .script developer
  • 528 posts
  • Location:greezeland
  • Interests:curiosity

Posted 23 July 2007 - 07:08 PM

For more information, do as Nuno already said: Compare with existing scripts.


i do it, but i can't make it out.

tnx anyway

#6 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10557 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 23 July 2007 - 07:36 PM

Don't worry - I'm already working on a good way to do this quickly between both projects which should become available soon if everything goes well.. :yahoo:

#7 Garfield

Garfield

    Member

  • .script developer
  • 96 posts
  • Interests:pretty much everything
  •  
    South Africa

Posted 24 July 2007 - 07:23 AM

Hey nuno,
i took the code above from irfanview script regarding file associations (specifically for bmp). but it doesn't work. Similar code doesn't work for other applications too. Is there any modification to do?



[FilesAssociations]
RegHiveLoad,"Tmp_software","%TargetDir%\i386\system32\config\software"
RegWrite,"HKLM",0x1,"Tmp_software\Classes\.BMP","","IrfanView.BMP"
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP Files","","IrfanView BMP Files"
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP Files\DefaultIcon","","#$pSystemDrive#$p\%WorkDir%\IrfanView\i_view32.exe"
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP Files\shell","","
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP Files\shell\open","","
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP Files\shell\open\command","","#$q#$pSystemDrive#$p\%WorkDir%\IrfanView\i_view32.exe#$q#$s#$q%1#$q"


The short of what Peter tried to say is that IrfanView.BMP should be BMP Files or the other way around..

But you are not allowed spaces in your simbolic link name thus change it to

[FilesAssociations]
RegHiveLoad,"Tmp_software","%TargetDir%\i386\system32\config\software"
RegWrite,"HKLM",0x1,"Tmp_software\Classes\.BMP","","BMP.Files"
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP.Files","","IrfanView BMP Files"
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP.Files\DefaultIcon","","#$pSystemDrive#$p\%WorkDir%\IrfanView\i_view32.exe"
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP.Files\shell","",""
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP.Files\shell\open","",""
RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP.Files\shell\open\command","","#$q#$pSystemDrive#$p\%WorkDir%\IrfanView\i_view32.exe#$q#$s#$q%1#$q"


Or better here is a working IrfanView script
Attached File  IrfanView.Script   739.23KB   981 downloads

#8 pscEx

pscEx

    Platinum Member

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

Posted 24 July 2007 - 08:46 AM

RegWrite,"HKLM",0x1,"Tmp_software\Classes\BMP.FILES\DefaultIcon","","#$pSystemDrive#$p\%WorkDir%\IrfanView\i_view32.exe"

If there are environment variables in the registry value, you need the type 0x2
(compare my base description above)

Peter

#9 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10557 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 24 July 2007 - 11:28 AM

Very good info! :yahoo:

#10 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 24 July 2007 - 03:46 PM

Hey nuno,
i took the code above from irfanview script regarding file associations (specifically for bmp). but it doesn't work. Similar code doesn't work for other applications too. Is there any modification to do?

Sorry for this trouble but i have make some change for VistaPE
I have now change it
Redownload MakeScript it must work now

@PSC
Can we use the same code registry for association with VistaPE and LiveXP
This code registry is it correct for Vista ? (I have copied it from 7zip.script for VistaPE)

#11 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10557 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 24 July 2007 - 04:13 PM

Pedrole15, please wait a bit - there have been a lot of recent changes on the way of scripts are being written to make them compatible across projects. Instead of making scripts with support for two projects we should be making a single script that can run on all these projects at once and be prepared for the next.

Last night I've finished the registry write code inside the api.script and script.project for livexp (using as test project since this also applies for vistape /nativeex/nativepe/bartPEcore and even installed windows if necessary)

Only missing the file association code - which for some strange reason is not yet working as needed - it will write all the needed keys, but then these values seem reset when loading the boot disk - strange - but fixable, most hard work is almost complete.

There is a new webserver that I've just uploaded this morning specifically created for livexp - inside your download center add livexp.boot-land.net and get the latest files.

Look inside the new scripts to see examples of this new sort of scripting.

So far I'm debugging dependency viewer trying to associate with dll files - all reg keys appear to be correctly written, but still doesn't work.. :)

Look inside api.script on the build folder for the functions that are used and inside script.project for details on the available functions.

On the bottom of the api.script file you also find a short example of how this file association can later be used inside scripts - everything gets really simple for people when writing their scripts.


Everyone is invited to join the testing and give their ideas! :yahoo:

#12 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 24 July 2007 - 04:35 PM

:yahoo:

#13 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10557 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 24 July 2007 - 04:51 PM

Give me another night to solve this detective case.. :yahoo:

#14 billonious

billonious

    Silver Member

  • .script developer
  • 528 posts
  • Location:greezeland
  • Interests:curiosity

Posted 31 July 2007 - 07:40 PM

Hoops, it seems that i lost many replies here. i though this topic was closed. i fall in work to make irfanview.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users