Jump to content











Photo
- - - - -

Hard-coded paths


  • Please log in to reply
19 replies to this topic

#1 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 26 December 2007 - 09:59 PM

At this moment does exist a way in order to avoid hardcoded paths in scripts?


Sun Java VM, for example, I tried that it doesn't work in any way without hardcoded registry entries...

And other software to properly work needed hardcoded paths in ".ini", ".dat" files...

In some scripts I like prefer pre-configurated application settings and expected applications inter-operability (plugins, shell extensions, etc) rather than a software that every time you launch it is as the first time... then at this moment (as I try) in certain cases to use hardcoded paths is practically unavoidable... but, then the compatibility is reduced... :cheers:

Then, I decided to add a warning in those related script threads... :cheers:


I also noticed that not always "%SystemRoot%" variable, for example, works fine under all applications...


Then, please: which is the actual state of the art?



As always, every comment is welcome! :cheers:

#2 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 26 December 2007 - 10:45 PM

Generally, expandable 0x2 registry entries work.

IZArc and UltraISO require a couple of registry entries with hard-coded paths, which I worked around by writing an app that runs at startup which expands the strings and writes the full paths. I guess it works like Sherpya's RegExpander.

http://galapo.boot-l...on/IZArc.script
http://galapo.boot-l...UltraISO.script

Regards,
Galapo.

#3 NightMan

NightMan

    Frequent Member

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

Posted 27 December 2007 - 11:09 AM

online

See "RegAddBoot" command example in 7-Zip.script or UniExtract.script or AgentRansack.script, setting will be add during boot by vpeldr.exe ... :cheers:

#4 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 28 December 2007 - 10:15 AM

Generally, expandable 0x2 registry entries work.

IZArc and UltraISO require a couple of registry entries with hard-coded paths, which I worked around by writing an app that runs at startup which expands the strings and writes the full paths. I guess it works like Sherpya's RegExpander.

http://galapo.boot-l...on/IZArc.script
http://galapo.boot-l...UltraISO.script

Regards,
Galapo.

Interesting, but is your app wrote ex novo for every single scripts where it is needed or is it already integrated in VistaPE?
And how could I do a similar choice in my scripts?
Thank you! :cheers:

#5 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 28 December 2007 - 10:36 AM

online

See "RegAddBoot" command example in 7-Zip.script or UniExtract.script or AgentRansack.script, setting will be add during boot by vpeldr.exe ... :cheers:

Really this is a great feature, but unfortunately in my environment seems to me that it doesn't work...

The following are some strings that I've added in my recent scripts:

RegAddBoot,"HKLM",0x1,"DEFAULT\Software\Toggle Software\ToggleMOUSE\Settings","Installed","%PE_Programs%\%ProgramFolder%"

RegAddBoot,"HKLM",0x1,"SOFTWARE\Classes\CLSID\{E23FE9C6-778E-49D4-B537-38FCDE4887D8}\InprocServer32","","%PE_Programs%\%ProgramFolder%\axvlc.dll"

RegAddBoot,"HKLM",0x1,"SOFTWARE\JavaSoft\Java Runtime Environment\1.6","RuntimeLib","%PE_Programs%\%ProgramFolder%\jre1.6.0_03\bin\client\jvm.dll"

And the following are some entries that I found in "VISTAPE.CFG" (both on UFD and on CD-ROM), but seems that @boot then it writes nothing in the registry:

"HKLM",0x1,"DEFAULT\Software\Toggle Software\ToggleMOUSE\Settings","Installed","%CDDrive%\Programs\Toggle\ToggleMOUSE"

"HKLM",0x1,"SOFTWARE\Classes\CLSID\{E23FE9C6-778E-49D4-B537-38FCDE4887D8}\InprocServer32","","%CDDrive%\Programs\VideoLAN\VLC\axvlc.dll"

"HKLM",0x1,"SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0_03","RuntimeLib","%CDDrive%\Programs\Java\jre1.6.0_03\bin\client\jvm.dll"



Thank you for your reply, I hope that I wrong something and that the function will work! :cheers:


Btw: I've added the latest "7-Zip.script", "UniExtract.script" and "AgentRansack.script" in my VistaPE, and at the same seems it doesn't writes nothing in the registry too...

[WB 074 * VistaPE 011]

#6 pscEx

pscEx

    Platinum Member

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

Posted 28 December 2007 - 10:40 AM

There is a way (in XP / W2003, unknown whether in Vista, too) to avoid at least a couple of hardcoded paths.

Drivers ans services (maybe everything in %systemroot% or %systemroot%\system32) do not need the full path, the *.sys / *.dll name is in most cases sufficient.

Peter

#7 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 28 December 2007 - 10:51 AM

There is a way (in XP / W2003, unknown whether in Vista, too) to avoid at least a couple of hardcoded paths.

Drivers ans services (maybe everything in %systemroot% or %systemroot%\system32) do not need the full path, the *.sys / *.dll
name is in most cases sufficient.

Peter

Thank you, psc, for the hint... I'm sure that it will be useful!



Btw: pleased to see you! :cheers:

#8 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 28 December 2007 - 11:24 AM

And how could I do a similar choice in my scripts?


Here's the relevant lines from the IZArc script:
If,NotExistFile,"%Target_prog%\ExpEnvVar\ExpEnvVar.exe",Add_Shortcut,AutoStart,,%PE_Programs%\ExpEnvVar\ExpEnvVar.exe,ExpEnvVar

If,NotExistFile,"%Target_prog%\ExpEnvVar\ExpEnvVar.txt",FileCreateBlank,"%Target_prog%\ExpEnvVar\ExpEnvVar.txt"

If,NotExistFile,"%Target_prog%\ExpEnvVar\ExpEnvVar.exe",Unpack,ExpEnvVar,,True,%Target_Prog%,ExpEnvVar,ExpEnvVar.exe

...

reg_add,0x2,"%reg%\Microsoft\Windows\CurrentVersion\App Paths\IZArc","","%PE_Programs%\%ProgramFolder%\IZArc.exe"

TXTAddLine,"%Target_prog%\ExpEnvVar\ExpEnvVar.txt","HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\IZArc#$c","Append"

...

So the idea is that you write the registry entry
reg_add,0x2,"%reg%\Microsoft\Windows\CurrentVersion\App Paths\IZArc","","%PE_Programs%\%ProgramFolder%\IZArc.exe"
and then write the equavalent in the ExpEnvVar.txt
TXTAddLine,"%Target_prog%\ExpEnvVar\ExpEnvVar.txt","HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\IZArc#$c","Append"
which ExpEnvVar.exe reads upon startup and expands and writes the full paths. It's not exactly tidy, but it works. A string value can be specified after the '#$c'.

Regards,
Galapo.

#9 NightMan

NightMan

    Frequent Member

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

Posted 28 December 2007 - 11:48 AM

online
problem here:
RegAddBoot,"HKLM",0x1,"DEFAULT\Software\Toggle Software\ToggleMOUSE\Settings","Installed","%PE_Programs%\%ProgramFolder%"
change it to
RegAddBoot,"HKU",0x1,".DEFAULT\Software\Toggle Software\ToggleMOUSE\Settings","Installed","%PE_Programs%\%ProgramFolder%"
and all will be work fine :cheers:

#10 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 28 December 2007 - 03:47 PM

@ NightMan

It does not work... :cheers:

I tried many trials (with some variant), but it does not write in registry...

Maybe some settings in Main Configuration and/or some further script (SATA Drivers, for example) are needed?

I do not know what to think... :cheers:

#11 pscEx

pscEx

    Platinum Member

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

Posted 28 December 2007 - 03:56 PM

I tried many trials (with some variant), but it does not write in registry (please, see screenshots: in registry, for example, are missing "Macromedia" and "Java" entries and other...).

Hi Online!

Frustrating if a user sees that his child is not coming alive.

But also frustrating if a 'mentor' sees that his 'student' forgot all instructions of the last months.

I tried many trials (with some variant)

Tell us about your different trials (including your intention) you made, add the scripts (if not standard), add logs, etc.

If you already have made some descriptions anywhere else:
As 'helper' I do not want to google. I want to have all necessary info in one post!

Peter

#12 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 28 December 2007 - 05:15 PM

@ psc

Hi, psc!

:cheers: You are right... but only generally speaking (and I agree), because of in this specified case the issue is about 1 single command related and I thought that further details (in addition to those already described in above posts) was not too useful...

However, the following are some variant tried in some scripts and at bottom some related results in "vistape.cfg":

RegAddBoot,"HKCU",0x4,"DEFAULT

RegAddBoot,"HKCU",0x4,".DEFAULT

RegAddBoot,"HKU",0x4,"DEFAULT

RegAddBoot,"HKU",0x4,".DEFAULT

RegAddBoot,"HKU",0x4,"SOFTWARE

RegAddBoot,"HKU",0x4,".SOFTWARE





"HKCU",0x4,"DEFAULT...

"HKCU",0x4,".DEFAULT...

"HKU",0x4,"DEFAULT...

"HKU",0x4,".DEFAULT...

"HKU",0x4,"SOFTWARE...

"HKU",0x4,".SOFTWARE...



The issue seems related to the fact that the command "RegAddBoot" doesn't write in registry (at least in my registry)... and I executed istructions meticulously...
About my intentions, please read more carefully my starting post... :cheers: :cheers: :cheers:

#13 pscEx

pscEx

    Platinum Member

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

Posted 28 December 2007 - 05:49 PM

However, the following are some variant tried in some scripts and at bottom some related results in "vistape.cfg":

[code=auto:0]RegAddBoot,"HKCU",0x4,"DEFAULT RegAddBoot,"HKCU",0x4,".DEFAULT RegAddBoot,"HKU",0x4,"DEFAULT... [shortened by psc]

In this case you are right.I tried the RegAddBoot with v10 and v11 beta and the result is 'no comment'.I do not know the reason why you really need Vista.(Just to have the latest SW means: Just to have the currently onknown and some additional troubles in addition to your currently known troubles)As I heard, integration of new / unknown hardware should be a bit easier (But if you do not need ...)Onspite of that: Maybe you switch to something consolidated:
  • XP or W2003 by Bill G.
  • nativeEX based project by WB community
  • nativeEx_barebone
  • LiveXP
  • NativePE
Peter

#14 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 28 December 2007 - 08:49 PM

I do not know the reason why you really need Vista.

Simple: because I like it.

Exactly as I should like a car... for example: english cars are more different compared to deutsch cars, and there are admirers of both ones... just why about their different features (however, I prefer the 2nd one... :cheers:)... and maybe ideal should be to own one for any situation (if it was possible)... but I do not think so... :cheers:

I like the challenge, too... and Vista (that I set totally restrictions free: UAC disabled, DEP disabled, True Administrator Privileges allowed...) has its appeal for me.


However, this point of discussion is VistaPE related... and its Beta version (011).

And you know: a possible bug should not be the end of the world (even supposing that it is a bug, and I do not know it).

Furthermore, seems to me that this topic ("Hard-coded paths" > "RegAddBoot") describes an issue very significant in other PE environments too... and I think that if it comes solved (if it is a bug, and I do not know it) then results should be so very interesting in absolute... and for all other PE projects too. :cheers:


Btw1: IMHO.

Btw2: I also use XP Pro SP2... but it does not amuse me... :cheers: :cheers:

Btw3: I understand your (technical?) arguments (and I partially agree), but I respectfully remember that do not exist only those... I like Vista just because it is so ... :cheers:

#15 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 29 December 2007 - 08:35 AM

@ NightMan

Now, all works so fine :cheers: and really this is a great feature! :cheers:

The initial failure was due to the fact that I misunderstood your post: I mistakenly thought that also SOFTWARE required "HKU" and/or initial dot, and obviously it didn't work...
Then I tried some scripts contemporarely with different combinations in their RegAddBoot-strings, but it doesn't work...
Finally, I restarted from zero with 1 script at a time, then I understood what was wrong...

It seems that if in "vistape.cfg" exist incorrect strings "RegAddBoot" related, then it writes nothing at all in the registry (with logfile obviously error-free)...


However, great feature: really!!! :cheers:

#16 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 31 December 2007 - 06:08 PM

@ Galapo

Thank you for your hint, now I know more also about that! :cheers:

#17 NightMan

NightMan

    Frequent Member

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

Posted 01 January 2008 - 12:48 PM

It seems that if in "vistape.cfg" exist incorrect strings "RegAddBoot" related, then it writes nothing at all in the registry (with logfile obviously error-free)...

yes, if you start vpeldr from command line you can see that it crashed ... fixed :cheers:

#18 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 18 February 2008 - 06:48 PM

@ NightMan


Please, could you tell me how translate the following line about "RegAddBoot" function?

RegWrite,"HKLM","0x1","Tmp_setupreg_hiv\



Thank you! :)

#19 NightMan

NightMan

    Frequent Member

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

Posted 18 February 2008 - 07:25 PM

Something like this :)
RegAddBoot,"HKLM","0x1","SYSTEM\"


#20 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 18 February 2008 - 08:31 PM

Something like this :)

RegAddBoot,"HKLM","0x1","SYSTEM\"

Thanks! :(




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users