Jump to content











Photo
- - - - -

VistaPE beta 011


  • Please log in to reply
81 replies to this topic

#1 fuwi

fuwi

    Frequent Member

  • Expert
  • 135 posts
  • Location:Switzerland
  •  
    Switzerland

Posted 22 November 2007 - 02:57 PM

in the History of changes of VistaPE beta 011, i read:
8. now folder with programs not linked to "Y:", be careful and use API for shortcuts
:cheers:
my question is now:
how can i make a registry entry, that contains a path to an application on the boot media?
so what is the replacement for %LinkDir% in this code:
...

...

[Variables]

%ProgramTitle%=SumatraPDF

%ProgramEXE%=SumatraPDF.exe

%ProgramFolder%=SumatraPDF

%LinkDir%=Y:\%ProgramFolder%



[process]

Echo,Processing %ProgramTitle%...

Add_Shortcut,StartMenu,Office

Unpack,Files,SumatraPDF.7z

RegHiveLoad,Tmp_Software,%HIVE_HKU%

RegWrite,"HKLM",0x1,"Tmp_Software\Classes\.pdf","","SumatraPDF"

RegWrite,"HKLM",0x1,"Tmp_Software\Classes\.pdf","Content Type","application/pdf"

RegWrite,"HKLM",0x2,"Tmp_Software\Classes\SumatraPDF\DefaultIcon","","%LinkDir%\SumatraPDF.exe,0"

RegWrite,"HKLM",0x1,"Tmp_Software\Classes\SumatraPDF\shell","","open"

RegWrite,"HKLM",0x1,"Tmp_Software\Classes\SumatraPDF\shell\open\command","","%LinkDir%\SumatraPDF.exe #$q%1#$q"

RegHiveUnLoad,"Tmp_Software"

...

...
any help would be appreciated
fuwi :cheers:

#2 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 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 November 2007 - 03:28 PM

Use this code to associate SumatraPDF.exe with pdf files:
[Variables]%ProgramTitle%=SumatraPDF%ProgramEXE%=SumatraPDF.exe%ProgramFolder%=SumatraPDF[process]Add_ShortcutAssociate_file,pdfUnpack,Files,SumatraPDF.7z
Look here for more details:http://www.boot-land.net/forums/index.php?showtopic=2707


%LinkDir% is no longer required.

:cheers:

#3 NightMan

NightMan

    Frequent Member

  • .script developer
  • 433 posts
  • Location:Russian, Moscow

Posted 23 November 2007 - 08:13 AM

fuwi

You can try use "%PE_Programs%\%ProgramFolder%" :cheers:

#4 fuwi

fuwi

    Frequent Member

  • Expert
  • 135 posts
  • Location:Switzerland
  •  
    Switzerland

Posted 23 November 2007 - 10:02 AM

Thanks Nuno Brito & NightMan

i tried the solution of Nuno Brito (Associate_file,pdf in [Process], all RegWrite's removed)
it doesn't work for me, in the registry, the path in pdffile\shell\open\command ist now "!CD\Programs\SumatraPDF\SumatraPDF.exe" "%1"
(!CD instead the actual CD-driveletter)

@NightMan
do you mean: %LinkDir%=%PE_Programs%\%ProgramFolder%
and leaving the RegWrite's unchanged?

Thanks, fuwi

#5 NightMan

NightMan

    Frequent Member

  • .script developer
  • 433 posts
  • Location:Russian, Moscow

Posted 23 November 2007 - 11:54 AM

hm ... it's very interesting... use "RunFromRam,True" and all will be work, no way right now make true link to program in registry if you place program to cd ... i try fix it soon :cheers:

#6 fuwi

fuwi

    Frequent Member

  • Expert
  • 135 posts
  • Location:Switzerland
  •  
    Switzerland

Posted 23 November 2007 - 11:58 AM

:cheers: Thanks NightMan

fuwi

#7 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 24 November 2007 - 08:34 PM

I am a little unhappy that the beta downloaded through Winbuilder over-wrote my working Release 10 directory.

In Virtual PC 2007:

1. I can't boot with Grub4DOS as teh boot manager. No matter which Grub4DOS skin I choose, I get white text on a black background and, when it tries to boot:

Booting 'VistaPE'



chainloader /bootmgr



error 17: FIle not found\



press any key to continue ...

When I press a key, it goes back to the menu.

2. I can boot using IsoLinux boot manager, but not without intervention. If I wait for the timer on the intial screen to count down to zero, it just starts aggain. I have to press <Enter> to get it to boot.

#8 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 24 November 2007 - 10:37 PM

I downloaded a fresh copy of beta 11 into a new directory with the same results.

#9 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 25 November 2007 - 10:47 AM

I can confirm that, at least with PDF extension (I still didn't try it with other extensions), the "associate_file,pdf" function doesn't work...

I had already noticed this behaviour with another PDF Reader and with SumatraPDF 0.7 the situation doesn't change (please, see the screenshot).

In order to work "PDF file association" I had used some registry entries in my old SumatraPDF 0.7 script that I've added also in my updated script for use with VistaPE 010, and it works fine.

About "LinkDir" issue I'm sure that it should be solved soon, meanwhile I think that two workarounds exist (about this specific case):

1. To change "RunFromRam,True" with "RunFromRam,False" and to change "X:\Program Files\" with "Your CD-ROM Drive Letter:\Programs\" in two lines (this is a ugly workaround useful only for both personal and aimed use, but it works).

RegHiveLoad,Tmp_software,%RegSoftware%

RegWrite,&#34;HKLM&#34;,0x1,&#34;Tmp_software\Classes\.pdf&#34;,&#34;&#34;,&#34;SumatraPDF&#34;

RegWrite,&#34;HKLM&#34;,0x1,&#34;Tmp_software\Classes\.pdf&#34;,&#34;Content Type&#34;,&#34;application/pdf&#34;

RegWrite,&#34;HKLM&#34;,0x1,&#34;Tmp_software\Classes\SumatraPDF\DefaultIcon&#34;,&#34;&#34;,&#34;X&#58;\Program Files\SumatraPDF\SumatraPDF.exe,0&#34;

RegWrite,&#34;HKLM&#34;,0x1,&#34;Tmp_software\Classes\SumatraPDF\shell&#34;,&#34;&#34;,&#34;open&#34;

RegWrite,&#34;HKLM&#34;,0x1,&#34;Tmp_software\Classes\SumatraPDF\shell\open\command&#34;,&#34;&#34;,&#34;&#34;&#34;X&#58;\Program Files\SumatraPDF\SumatraPDF.exe&#34;&#34; &#34;&#34;%1&#34;&#34;&#34;

RegHiveUnLoad,&#34;Tmp_software&#34;

2. To add neither "associate_file,pdf" function nor registry entry lines and to use at program start-up the option "Make SumatraPDF default application for PDF files?".

:cheers:

Attached Thumbnails

  • 1.png


#10 was_jaclaz

was_jaclaz

    Finder

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

Posted 25 November 2007 - 12:38 PM

1. I can't boot with Grub4DOS as teh boot manager. No matter which Grub4DOS skin I choose, I get white text on a black background and, when it tries to boot:

Booting &#39;VistaPE&#39;



chainloader /bootmgr



error 17&#58; FIle not found\



press any key to continue ...

When I press a key, it goes back to the menu.


Most probably there is a problem in the menu.lst.

When you go back to the menu, press [b]c[/c] to enter grub4dos command mode, then type:
find --set-root /bootmgr
and press [ENTER]
then type
chainloader /bootmgr
and press [ENTER]
then type
boot
and press [ENTER]

if it does not work, it may be a problem with the way the boot media is detected, then try the following:
find &#40;
and press [TAB]
grub4dos will give you autocompletion options, such as

(fd0) (cd) (hd0) (hd1)

complete the line with the media from which you are booting, like:
find &#40;hd0,
or
find &#40;f
and press [TAB]
grub4dos will give you autocompletion options, such as

(hd0,0) (hd0,1)

or

(fd0)

continue typing and put a forward slash "/" like:
find &#40;hd0,0&#41;/
or
find &#40;fd0&#41;/
and press [TAB]
grub4dos will list files on that device, see if you can find the bootmgr file, if yes (say on (hd0,1) issue these commands:
root &#40;hd0,1&#41; &#91;ENTER&#93;

chainloader /bootmgr &#91;ENTER&#93;

boot &#91;ENTER&#93;
if it does not work, try using:
rootnoverify &#40;hd0,1&#41; &#91;ENTER&#93;

chainloader /bootmgr &#91;ENTER&#93;

boot &#91;ENTER&#93;
(you can also use the [TAB] autocompletion on other commands, i.e. chainloader /b[TAB] will list all files beginning with "b", pay attention to CaSe oF fIlEnAmE, bootmgr is not the same as BOOTMGR or as Bootmgr)

Once you have found the correct command sequence just edit accordingly menu.lst (the last "boot" statement is ONLY needed when grub4dos is used in Command mode)

jaclaz

#11 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 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 25 November 2007 - 01:18 PM

i tried the solution of Nuno Brito (Associate_file,pdf in [Process], all RegWrite's removed)
it doesn't work for me, in the registry, the path in pdffile\shell\open\command ist now "!CD\Programs\SumatraPDF\SumatraPDF.exe" "%1"
(!CD instead the actual CD-driveletter)

@NightMan
do you mean: %LinkDir%=%PE_Programs%\%ProgramFolder%
and leaving the RegWrite's unchanged?


This association error should be reported to NightMan or PedroLe15 to be properly solved.

Using static paths is not a good solution since it will only be a temporary workaround leaving this issue unsolved for the next time someone needs to associate a file.

Will try to find time some to debug the reason why it happens.

:cheers:

#12 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 25 November 2007 - 04:17 PM

This association error should be reported to NightMan or PedroLe15 to be properly solved.

Using static paths is not a good solution since it will only be a temporary workaround leaving this issue unsolved for the next time someone needs to associate a file.

Will try to find time some to debug the reason why it happens.

:cheers:

Hi nuno
Galapo have found an error in Api Associate , see here

In Api.script replace in section [do_associate_action_open]
%my_file_type_label% by #1file

:cheers:
Pedro

#13 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 25 November 2007 - 09:26 PM

i tried the solution of Nuno Brito (Associate_file,pdf in [Process], all RegWrite's removed)
it doesn't work for me, in the registry, the path in pdffile\shell\open\command ist now "!CD\Programs\SumatraPDF\SumatraPDF.exe" "%1"
(!CD instead the actual CD-driveletter)

Hi all
In previous version of Api.script for VistaPE I use:
%PE_Programs%=y: and it was working
Now NightMan use:
%PE_Programs%=!CD\Programs

For making Associate work we must know what is the drive letter of !CD
If it is always Y: why using !CD , if not how to find it ?

:cheers:
Pedro

#14 NightMan

NightMan

    Frequent Member

  • .script developer
  • 433 posts
  • Location:Russian, Moscow

Posted 26 November 2007 - 02:42 PM

ALL

Hm... i really not like mount folder with programs as drive y:, it was made for very old version of VistaPE, when we have only BS Explorer and all shortcuts was amked directly from scripts, without API and other automation... now all is working more better, but for registry we need add full path to program, we must know cd drive letter (every time different) or add global environment variable (inside VistaPE), i try use "set" and "setenv" commands, try add variable directly to registry, but VistaPE can not see it, can anyone help with it? Also i can return drive Y: back, or parse registry files at boot time (from vpeldr.exe)... not registry API works well only if place program to boot.wim .... any ideas?

#15 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 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 26 November 2007 - 04:50 PM

I have a (crazy) idea.

You can't change all dynamic paths on the registry because you require harcoded settings inside the reg hives to make them valid.

But what happens if you create a small program to scan all registry keys and change all references from !CD to whatever drive that points to the correct location while the boot disk is starting up? (Y: on this example)


It would allow to use a static value (whenever absolutely necessary) and still keep the boot disk dynamic and flexible to be used in other configurations.

Scanning all registry keys and replacing any !CD values is a fairly quick process when using an efficient coding.


What do you think? :cheers:

#16 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 26 November 2007 - 07:32 PM

Hi NightMan
Is it possible to run a little au3 at boot time before parsing shortcut ?
This au3 scan all cd drive to find the file Vistape.cd and write the letter of cd in registry
So
In Script.project we add %LinkDrive%=#$pCDDRIVE#$p (Default value)
In section [RunFrom_Ram] we add If,#1,Equal,True,Set,"%LinkDrive%","#$pSystemDrive#$p\Program#$sFiles"
And in Associate we change %PE_Programs% by %LinkDrive%

:cheers:
Pedro

Attached Files



#17 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 26 November 2007 - 10:23 PM

But what happens if you create a small program to scan all registry keys and change all references from !CD to whatever drive that points to the correct location while the boot disk is starting up? (Y: on this example)


It would allow to use a static value (whenever absolutely necessary) and still keep the boot disk dynamic and flexible to be used in other configurations.

Hi Nuno,

This sounds like the (temporary until I have a better idea) solution I came up with to a couple of registry entries that required hard-coded paths for UltraISO and IZArc. ExpEnvVar expands variables passed to it from a text file generated during build when the variables are unknown. Here's a couple of lines from IZArc:
reg_add,0x2,&#34;%reg%\Microsoft\Windows\CurrentVersion\App Paths\IZArc&#34;,&#34;&#34;,&#34;%PE_Programs%\%ProgramFolder%\IZArc.exe&#34;

TXTAddLine,&#34;%Target_prog%\ExpEnvVar\ExpEnvVar.txt&#34;,&#34;HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\IZArc#$c&#34;,&#34;Append&#34;
The first line is the one written to registry. The second is the one written to the text file which ExpEnvVar will read and then expand the registry entries listed upon boot. So since %PE_Programs% in LiveXP is '%SystemDrive%\Program Files', this is expanded to 'x:\Program Files' with ExpEnvVar upon boot.

Of course, this is a bit rough, and I'd be happy is someone could write something better than what I've done.

Here's the AutoIt code anyway:
ExpEnvVar.au3
#NoTrayIcon

Opt&#40;&#34;ExpandEnvStrings&#34;, 1&#41;

$file = FileOpen&#40;@ScriptDir & &#39;\ExpEnvVar.txt&#39;, 0&#41;

If $file = -1 Then Exit

While 1

	$line = FileReadLine&#40;$file&#41;

	If @error = -1 Then ExitLoop

	If $line <> &#34;&#34; Then

		$array = StringSplit&#40;$line, &#34;,&#34;&#41;

		$reg_var = RegRead&#40;$array&#91;1&#93;,$array&#91;2&#93;&#41;

		RegWrite&#40;$array&#91;1&#93;,$array&#91;2&#93;,&#34;REG_SZ&#34;,$reg_var&#41;

	EndIf

Wend

FileClose&#40;$file&#41;

Regards,
Galapo.

#18 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 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 26 November 2007 - 10:50 PM

So it is possible - nice to read your solution! :cheers:

#19 NightMan

NightMan

    Frequent Member

  • .script developer
  • 433 posts
  • Location:Russian, Moscow

Posted 27 November 2007 - 08:57 AM

Nuno Brito
Your "crazi" idea is not bad, i already think about it, but it will be not fast (theoretically)... but it's really interesting :cheers:

pedrole15
Sorry, but your method is not work, VistaPE ("set" command) can not see new values and i not know why :cheers:


Galapo
Interesting ...may be it's will be better idea :cheers:

Thanks :cheers:

#20 NightMan

NightMan

    Frequent Member

  • .script developer
  • 433 posts
  • Location:Russian, Moscow

Posted 29 November 2007 - 08:38 AM

ALL

I plan make new config file for vpeldr.exe (VistaPE Loader), one file will be at "x:\windows\system32" folder and one at root folder at any device, config file will be contain main settings, shortcuts (before making link, vpeldr will be check for file existing), autorun, registry setting, file association setting, shell setting (for PE Shell Swapper)... (default) program folder will not be mounted as drive Y:, but all settings can contain variable with path to programs... boot.wim will be contain core files and possible change many setting without rebuilding it, true hotswap for program media will be support too...

new vistape.cfg example:
&#91;main&#93;

screen=800x600&#59;screen resolution

wpeinit=normal&#59;or normal

mountprogram=yes&#59;mount program folder as drive Y&#58;

drivers=drivers&#59;filder with drivers

defaultshell=Total Commander&#59;default shell for PE Shell Swapper



&#91;shortcut&#93;

Category|Program Title|Path|Parameters





&#91;autorun&#93;

x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;

normal|Program Title|x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;

hide|Program Title|x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;

wait|Program Title|x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;

waithide|Program Title|x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;

wait+hide|Program Title|x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;

nowait|Program Title|x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;

nowaithide|Program Title|x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;

nowait+hide|Program Title|x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;

hide+wait|Program Title|x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;

hidewait|Program Title|x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;

hidenowait|Program Title|x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;

hide+nowait|Program Title|x&#58;\windows\system32\cmd.exe /c echo test &#58;&#41;



normal|Program Title|x&#58;\windows\system32\cmd.cmd /c echo test &#58;&#41;

normal|Program Title|x&#58;\windows\system32\cmd.bat /c echo test &#58;&#41;



&#91;registry&#93;

&#34;HKLM&#34;,0x1,&#34;Tmp_software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes&#34;,&#34;System,0&#34;,&#34;System,204&#34;





&#91;association&#93;

pdf,x&#58;\windows\system32\cmd.exe



&#91;shells&#93;

Program Title|x&#58;\windows\system32\cmd.exe


#21 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 01 December 2007 - 01:56 AM

Hi NightMan
Until you find a better way
For making association work compile this au3 file to UpdateAssoReg.exe
Encode it in "Standard-3-Config.script" in Build folder
and add just after
#autorun

TXTAddLine,&#34;%TargetDir%\windows\system32\winpeshl.ini&#34;,&#34;autorun.cmd&#34;,&#34;Append&#34;
this line
TXTAddLine,&#34;%TargetDir%\windows\system32\winpeshl.ini&#34;,&#34;UpdateAssoReg.exe&#34;,&#34;Append&#34;

Attached Files



#22 fuwi

fuwi

    Frequent Member

  • Expert
  • 135 posts
  • Location:Switzerland
  •  
    Switzerland

Posted 03 December 2007 - 08:01 AM

@pedrole15

good workarround!
but your code works only for VistaPE on bootable CD's, and not on bootable USB-Sticks.

so if you change in your code:
$CDRoms=DriveGetDrive&#40;&#34;CDROM&#34;&#41;

$PsyhCD=&#34;&#34;

If NOT @error Then

	For $i = 1 to $CDRoms&#91;0&#93;

		if&#40;FileExists&#40;$CDRoms&#91;$i&#93; & &#34;\vistape.cd&#34;&#41;&#41;then $PsyhCD=$CDRoms&#91;$i&#93;

	Next

EndIf



If&#40;$PsyhCD <> &#34;&#34;&#41; then 

$CDDriveLetter=StringLeft&#40;$PsyhCD,2&#41;;

with this, then it works also on USB-Sticks (my $BootDriveLetter is your $CDDriveLetter)
$Drives = DriveGetDrive&#40;&#34;ALL&#34;&#41;

For $i = 1 to $Drives&#91;0&#93;

	$Drives&#91;$i&#93; = StringUpper&#40;$Drives&#91;$i&#93;&#41;

	$DriveType = DriveGetType&#40;$Drives&#91;$i&#93;&#41;

	If DriveGetType&#40;$Drives&#91;$i&#93;&#41; = &#34;Removable&#34; or DriveGetType&#40;$Drives&#91;$i&#93;&#41; = &#34;CDROM&#34; Then

		If DriveStatus&#40;$Drives&#91;$i&#93;&#41; <> &#34;NOTREADY&#34; Then

			If FileExists&#40;$Drives&#91;$i&#93; & &#34;\VISTAPE.CD&#34;&#41; Then

				$BootDriveLetter = $Drives&#91;$i&#93;

				ExitLoop

			EndIf

		EndIf

	EndIf

Next

BTW:
i use booty's USBStick.script for making bootable VistaPE USB-Sticks. Works very well.

creating an environment variable 'CDDrive' doesn't make sense, because you have to reboot the system to have access to this variable!
RegWrite&#40;&#34;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment&#34;,&#34;CDDrive&#34;,&#34;REG_EXPAND_SZ&#34;,$CDDriveLetter&#41;;

@NightMan
i think, your vpeldr.exe also search just for CD-drives and not for other removable drives.
On booting from USB-Stick i get the message from vpeldr.exe 'Searching disk with programs...not found. Trying start "wpeinit.exe" and searching again...'

regards,
fuwi

#23 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 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 03 December 2007 - 09:59 AM

NightMan - looking on the config file you propose have only one suggestion - whenever possible avoid references to X:\ inside the new config file - using a variable value would make wonders when placing VistaPE on hard disk.

:cheers:

#24 NightMan

NightMan

    Frequent Member

  • .script developer
  • 433 posts
  • Location:Russian, Moscow

Posted 04 December 2007 - 01:41 PM

Nuno Brito
It's only example for file format, all already working, i need make more test and will upload it very soon :cheers: Now we have to config files, on in x:\windows\system32 for default setting and program in boot.wim, and one (or more) at cd (dvd, usb, hdd), we can change basic setting without rebuilding boot.wim, registry ad file association work very good, all program can be detected automaticaly... next is drivers, i plan move it from boot.wim to disk (not SATA drivers)... and i think about interactive mode for vpeldr for changing setting during boot process :cheers:

#25 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 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 04 December 2007 - 01:48 PM

Ok, nice to hear that you're on top of these things! :cheers:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users