Jump to content











Photo
- - - - -

SOLVED: Registry-Script for File-Type-Associations


  • Please log in to reply
16 replies to this topic

#1 st-dv

st-dv

    Frequent Member

  • Members
  • 121 posts
  •  
    Germany

Posted 15 June 2008 - 01:36 PM

hello,

nearly finished my VistaPE-CD.
Working with VistaPE v.11 and Winbuilder 074.

Now I have some tools "onboard" like f.e. 7zip, foxitpdfreader, vlcplayer...........

But now I wanted to associate special filetypes with these tools, f.e. PDF with Foxitreader, RAR,ZIP,ISO with 7Zip..... and so on.........

I think the best way would be using the Windows registry?
But till now I never worked with the registry ( in Winbuilder scripts ! )

How would a script has to be to realize this?

How do I write something to the vistape-registry? Is there a special "open with"-entry?? Where?


Would be great if anybody could help me..... thanks...


S-DV

#2 Max_Real Qnx

Max_Real Qnx

    Gold Member

  • Patrician
  • 1382 posts
  • Location:Istanbul
  • Interests:To be or not to be that is the question.
  •  
    Turkey

Posted 15 June 2008 - 02:40 PM

http://www.boot-land...?showtopic=4115


Need .NET Framework Version 2.0 Redistributable

Attached File  ConvRegToInf.rar   10.02KB   322 downloads

Inf to Script > WBuilder \ Tools->Convert ;)

#3 pscEx

pscEx

    Platinum Member

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

Posted 15 June 2008 - 08:03 PM

hello,

nearly finished my VistaPE-CD.
Working with VistaPE v.11 and Winbuilder 074.

Now I have some tools "onboard" like f.e. 7zip, foxitpdfreader, vlcplayer...........

But now I wanted to associate special filetypes with these tools, f.e. PDF with Foxitreader, RAR,ZIP,ISO with 7Zip..... and so on.........

I think the best way would be using the Windows registry?
But till now I never worked with the registry ( in Winbuilder scripts ! )

How would a script has to be to realize this?

How do I write something to the vistape-registry? Is there a special "open with"-entry?? Where?


Would be great if anybody could help me..... thanks...


S-DV

API's associate_file provides that (or should provide).
Look in api.Script under [Demo Usage]

Peter

#4 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10554 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 15 June 2008 - 09:21 PM

As Peter mentioned, there are already some cool methods built inside a project to help you at this task without need to write anything to the registry by yourself.


First, you will need to use app scripts.

If you're using VistaPE app scripts then this might already be your case for most apps.

---

Second, edit your script (on this case will pick on the pdfReader) and add this line under the [process] section:
associate_file,pdf

So that our script will then look like this:

[Variables]
%ProgramFolder%=PDFReader
%ProgramEXE%=Foxit Reader.exe
%ProgramTitle%=FOXIT PDF Reader

[Process]
Echo,Processing %ProgramTitle%...
If,NotExistFile,"%pFileBox1%\%ProgramEXE%",run,%ScriptFile%,Download
Echo,Processing %ProgramTitle%...
RunFromRam,%pCheckBox1%
CopyProgram,%pFileBox1%
Add_Shortcut,StartMenu,Office
associate_file,pdf


(changes are added in bold)

You can read the whole script from here:
http://vistape.net/p...DFReader.script


-------


There are however, a few more advanced options for associating your files (adding the options to edit, open with another file, etc, etc.)

Look inside the api.script file on your project - on the bottom there is a small set of examples that teach how each command can be used to the max
Here's an example (for vistaPE is similar since the app script code is shared)
http://livexp.boot-l...uild/api.script

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




This example should work fairly well for any other app script you like.

:)

#5 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 15 June 2008 - 10:26 PM

1- associate_file,html
2- associate_file,html,open,c:\test.exe
3- associate_file,html,open,c:\test.exe,/run=%2
4- associate_file,html,edit
5- associate_file,html,icon,c:\test.exe
6- associate_file,html,icon,%systemroot%\System32\Shell32.dll,-153

Sorry Nuno but under VistaPE only the first work :)

#6 pscEx

pscEx

    Platinum Member

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

Posted 16 June 2008 - 02:58 PM

Sorry Nuno but under VistaPE only the first work :)

I do not know a lot about VistaPE, but as the API functions are only a subset of standard WinBuilder statements, IMHO it should be possible to have under VistaPE the same functionality like under e.g. LiveXP.

Peter

#7 st-dv

st-dv

    Frequent Member

  • Members
  • 121 posts
  •  
    Germany

Posted 16 June 2008 - 03:43 PM

ok........

associate_file,pdf


Did not know that it would be so easy............... :))))


Thank you very much !

#8 pscEx

pscEx

    Platinum Member

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

Posted 16 June 2008 - 03:50 PM

ok........

associate_file,pdf


Did not know that it would be so easy............... :) )))


Thank you very much !

[German]
Darum schätze ich WinBuilder, seit ich es kenne!
[/German]
That is the reason that I like WinBuilder since the very first contact.
(Bad translation! Maybe a member with good German AND English knowledge delivers a better translation?)

Peter

#9 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 16 June 2008 - 04:18 PM

[German]
Darum schätze ich WinBuilder, seit ich es kenne!
[/German]
That is the reason that I like WinBuilder since the very first contact.
(Bad translation! Maybe a member with good German AND English knowledge delivers a better translation?)

Peter

I would say:
That's why i appreciate Winbuilder, since i've been introduced to it.
Or did you wanted a better german version? :)

:)

#10 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 16 June 2008 - 05:24 PM

Maybe a better English translation would be :):
That's why I felt in love with it at first glance....

(We Italians are a bit more Romantic, it's a known fact....:))

@Medevil
WHO introduced Peter to Winbuilder? :)
http://www.merriam-w...onary/introduce

I imagine something like:
Common Friend:This is Winbuilder...and this is Peter, psc for friends...
Winbuilder: How do you do...
Peter: How do you do, it's a pleasure to meet you, our Common Friend told me about your exceptional abilities....

:)

:)

jaclaz

#11 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 16 June 2008 - 05:51 PM

Maybe a better English translation would be :):
That's why I felt in love with it at first glance....

(We Italians are a bit more Romantic, it's a known fact....:))

Appearantly not romantic enought. Else you would not just felt in love, but actually fallen in love! :(

@Medevil
WHO introduced Peter to Winbuilder? :)
http://www.merriam-w...onary/introduce

I imagine something like:
Common Friend:This is Winbuilder...and this is Peter, psc for friends...
Winbuilder: How do you do...
Peter: How do you do, it's a pleasure to meet you, our Common Friend told me about your exceptional abilities....

:(

Common Friend = Mr. Browser :)

:)

#12 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 16 June 2008 - 06:03 PM

Appearantly not romantic enought. Else you would not just felt in love, but actually fallen in love! :)


Maybe I would have fallen in love, but Peter is German, so, maybe a little more detached...:)

..I actually had this in my mind:
http://vagalume.uol....el-in-love.html

:)

jaclaz

#13 pscEx

pscEx

    Platinum Member

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

Posted 16 June 2008 - 06:31 PM

Interesting how you discuss my feelings and emotions :)
But what about the nice English word OFFTOPIC?

Peter

#14 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 16 June 2008 - 06:47 PM

But what about the nice English word OFFTOPIC?

Sorry, don't understand what you wanna say!
Maybe your english is worst than you thought? :)

:)

#15 pscEx

pscEx

    Platinum Member

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

Posted 16 June 2008 - 06:54 PM

Sorry, don't understand what you wanna say!
Maybe your english is worst than you thought? :)

:)


I do not think so.
I never have had problems with my English.
Maybe some English speaking people have.

Peter

#16 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 17 June 2008 - 06:30 AM

I do not know a lot about VistaPE, but as the API functions are only a subset of standard WinBuilder statements, IMHO it should be possible to have under VistaPE the same functionality like under e.g. LiveXP.

Peter

Oh yes perhaps i can add missing thing by the reg_add command
In VistaPE the function associate_file is :
[do_associate]

echo,"Associate . #1 file"

If,#2,NotEqual,"",StrFormat,filename,#2,%CFileName%

If,#2,NotEqual,"",StrFormat,path,#2,%CPath%

If,#2,Equal,"",StrFormat,filename,%ProgramExe%,%CFileName%

If,#2,Equal,"",StrFormat,path,%PE_Programs%\%programFolder%\,%CPath%

If,%CPath%,Equal,,StrFormat,path,%PE_Programs%\%programFolder%\,%CPath%

#

IniWriteTextLine,"%VPE_CFG%","association","#1#$c%CPath%%CFileName%"
I don't know after how is interpreted the file vistape.cfg so i can't make any change here

What is the registry key for change the work Folder for a program ? ( this is for the add_shortcut function)

#17 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10554 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 17 June 2008 - 01:16 PM

Oh yes perhaps i can add missing thing by the reg_add command


Good news! :)



...
WHO introduced Peter to Winbuilder? :)
...
I imagine something like:
Common Friend:This is Winbuilder...and this is Peter, psc for friends...
Winbuilder: How do you do...
Peter: How do you do, it's a pleasure to meet you, our Common Friend told me about your exceptional abilities....

:)

:)

jaclaz


Don't need to go very far with your imagination.

It was two years ago during the sunny summer of July when Boot Land was just being inaugurated on the old hosting system that Peter presented some good ideas to make boot disks in a different manner.

At the time I had just finished working on Batcher and had Bart asked to move away from 911cd since the newer boot disk construction projects from Open Builder (later WinBuilder) were not based on bartPE and had no place for discussion inside 911cd.

At the time we were both bartPE/Reatogo users but these build projects were simply too static to allow expanding functionalities and an efficient solution for this matter was really necessary.

http://www.911cd.net...showtopic=17551

At the time I mentioned

There is always a solution, it just takes some time to find it sometimes..



Guess these last two years passed like a breeze.

:)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users