Jump to content











Photo
- - - - -

details details with win7PESE


  • Please log in to reply
35 replies to this topic

#1 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 30 July 2013 - 01:20 AM

I recently created a win7pese build (x64 for the moment soon to be followed up by x86 (making a multi-boot repair/instalation/multimedia(personal quirk I like my technical tools to be fun too) drive.)

 

anyway the build in winbuild went pretty much flawlessly and well testing it in vmware I decided I would copy,had planned to extract but imagex was not playing nice for unknown reasons, but I copied the "target" folder contents to a removable HDD then into VMware and manually tweaked the BCD so the thing would boot. This is so I could install a few extra programs and tweak a few things from with in the PE environment and have them persist then rebuild it ramdisk style.

 

Again everything here seemed to go flawlessly, However on reboot to test persistence, some things that get registered (eg. codecs from combind community codec pack (cccp), or the networking tool Hamachi) dont work. the files are still there and a reinstall from the installer (confirming to overwrite as needed) will make whatever it is work again until the next reboot where its the same story again.

 

Other details I care less about but the perfectionist in me would like to fix...

all icons on the desktop except "computer" and "recycle bin" used to have icons and in the property menus still do but on the desktop they are just a black square.

Icons pinned to start menu/bar get a (2) (3) (4) (and so on) upon every reboot unless I go to the user pinned folder and delete all the .lnk shorcuts there but then they just start over again.

 

Extra details that maybe important..

Aero of course wont work in vmware but the PE is setup to enable admin account and switch to it right after penetworking does its thing so on a capable computer it would hopefully jumpstart aero.

 

without premade scripts I am not skilled enough yet to take some random installer and install to an offline system, copying files is easy enough, but figureing out what it writes to the regestry, or what other files and settings it fiddles with is where I get lost. Hence my attempt to boot in and install from inside.

 

if anyone has some advice on fixing the regestry persistance issue, the weird icon and/or renaming issue it would be greatly appriciated.



#2 sbaeder

sbaeder

    Gold Member

  • .script developer
  • 1338 posts
  • Location:usa - massachusettes
  •  
    United States

Posted 30 July 2013 - 03:10 AM

Can't help on all of it, but registry "persistence" is always going to be an issue, since the image doesn't write back the current registry!   You'll need to capture the registry information and use that to insert the items into the registry while building the PE.

 

On the other issues, maybe others can comment



#3 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 30 July 2013 - 03:47 AM

ok do you know a simple waay to do that? should I get everything installed and just export the whole regestry from regedit, or is there some tool to moniter exactly what has changed and just back up those regestry values, or maybe something that catch's and stores regestry changes as they happen?

 

Ps: thanks btw.


Edited by tblo, 30 July 2013 - 03:48 AM.


#4 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 30 July 2013 - 06:40 AM

well after doing somthing else to have time to think & google-ing a few diffrent ways I found RegFromApp, after a brief issue wherein I discover that running the 64 or 32 bit version of regfromapp was dependant on the program being run/captured and not if the os was 64 or 32 bit.

 

I have now captured .reg files from cccp have to go capture them from a few more programs, then comes figuring out how to import them. offline regestries from the things I skimmed over seems like itll be easy but I have never delt with offline registries so I have no idea... Yet!



#5 muggles

muggles

    Newbie

  • Members
  • 24 posts
  • Location:New Orleans
  •  
    United States

Posted 30 July 2013 - 07:19 AM

The icon issue can be resolved by:

 

Shell->Explorer Shell->Do not remove arrows from shortcuts



#6 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 30 July 2013 - 09:47 PM

Thanks Muggles!

 

I didnt feel like rebuilding the PE from the top, though I might later, but knowing that was the problem I googled how to restore the shortcut arrows manually. upon reboot my icons are back and not black squares anymore!!! thanks!



#7 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 02 August 2013 - 02:20 AM

I think hamachi woulld be a great tool to have in PE grab possibly useful files from another computer even if the other computer is half way around the planet unfourtunataly while it runs after install it does not survive reboot. I have tried using both regfromapp and regshot, the former didnt give me anything the latter gave me a crapton most of w/ I exported from regedit reloaded after reboot and tried running hamachi. but after reboot hamachi always says "failed to connect to engine"(it's service) does not matter if I import the regestry files or not. So apparently I am missing something.

 

tips, tricks, advice, instructions all would be appriciated



#8 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 02 August 2013 - 04:13 AM

apparently VNC does the same thing, seems to be related to the "Service" not being installed on reboot w/ I guess isnt preserved on reboot nor restored by importation of regestry values.

 

-A direct solution is preferred  for the insight as to how to install,backup, and understand how services work. However, both to save in ramdisk size and to relieve my headache on this and as these tools will prolly be scenario specific I will prolly wind up putting the installers in the disk image a script to install them hidden out of the way and a shortcut with a nice icon to the script on either the desktop or startmenu.



#9 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 02 August 2013 - 11:57 PM

Ok so everything posted here is solved, I have programs installed registry values backed up and compiled into 3 big files depending on what "hive" they belong in. The shortcut arrow tip fixed the black Icon thing. As long as I delete the extra shortcuts generated for the start menu/bar when imaged and made to run from a ramdisk that wont apply. Disabled the auto switch to admin so I could write a bat script to initiate the driver pack thing (so aero will have its driver ready) import the "user" hive from file as importing to default seems to do nothing, and then the bat will launch the switch to admin. some finer details around that script are still coming together but it looks fine for the moment. The 2 programs that were being a pain (VNC and Hamachi) have a silent install option and no need to reboot, so a shortcut (with a nice icon) pointing to a bat script with 10 lines of txt can install then run what 500-800 line of exported registry values could not, this also means their not taking up space in the .wim file.

 

However, one curve ball I wasnt expecting and do need help with, portableapps.com. My intial build had the box ticked for it, but as I was deciding what I wanted where and how I would use it, in my rebuild I unticked the portableapps.com. It is going to be on a multiboot jumpdrive (with amongst other things a identical albeit x86 winpe environment) This way it would be available to a already booted computer and to all of the (windows based anyway) pe enivironment's on the jump drive and not take up space in the .iso.

 

In my intial build with the portableapps.com box ticked it would load fine. In the current build I try to load it up from a jumpdrive that has it on it and it says some bit of memory cant be refrenced and fails to start. so I used a second jumpdrive downloaded a brandnew copy of the installer and installed it to the new jump drive from within the PE environment (just to rule out corruption & maybe that it wasnt installed in the PE(counter intuitive to being portable but I thought it could be)) the new install however gave the same error and still would not run. sense winbuilder can put it in there and it runs its obviously capable, so what gives?


Edited by tblo, 02 August 2013 - 11:59 PM.


#10 muggles

muggles

    Newbie

  • Members
  • 24 posts
  • Location:New Orleans
  •  
    United States

Posted 03 August 2013 - 05:35 AM

The file: Projects\Win7PESE\Apps\Portable\PortableApps.script should contain all the clues you need. I see one needed dependency is wtsapi32.dll, You could also extract the included files in that archive and use them as well.

 

Good luck!



#11 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 03 August 2013 - 10:42 AM

well I rebuilt it with portableapps.com re-ticked but didnt include any apps and deleted the directory in the VMware session and it works beautifully. the build is almost done one last thing todo but the method eludes me for the moment.  I have written a whole craps ton of bat files to launch apps no matter what drive they are on and make it seem like they were there all along.

 

anyway one particular batch file I wrote is meant to be launched automatically at startup (simple bat inside the .wim that calls a .bat in the .iso (easier to modify should something go wrong, makes it a bit modular. that second bat installs the driver pack imports some user registry values and switches to admin in that order). anyway the bat('s) work perfectly on double click however, despite adding a runonce value to the registry with a descriptive name and a string value that is the path (X:\windows\pe\init.bat) (no brackets and tried both with and without quotes) it doesnt load the bat at startup for some reason. I also tried putting the bat in the startup folder but it wouldnt load at start but would run as soon as switched into the admin user (w/ totally defeated the point).

 

I would think making a simple script run at start up would be the easiest of my challenges, maybe a full good night sleep is order,ack!


Edited by tblo, 03 August 2013 - 10:43 AM.


#12 muggles

muggles

    Newbie

  • Members
  • 24 posts
  • Location:New Orleans
  •  
    United States

Posted 03 August 2013 - 10:57 AM

lot's of ways to do it, but I make use of the Portable Finder CMD in System Tools to find a tag file on my USB drive to run a batch from there. It executes late enough to create my shortcuts and the all the other crap I do. The custom  environmental variables are sweet to have (such as MyUSB :).



#13 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 03 August 2013 - 11:13 AM

I will definitly look into that, Thanks! As far as tag files go one of the things I learned to do (because of this project) in the last 3 days is write a batch file that scans every drive letter for a particular file (I used empty txt files that I would name things like usb.id or x64.id (for the drive or inside the iso respectivly)) something I knew could be done for years but just muddled through for my first time in the last 3 days. there was a typo in the source I refrenced and a few extra spaces where they didnt belong that served to trip me up but learning all the way.



#14 muggles

muggles

    Newbie

  • Members
  • 24 posts
  • Location:New Orleans
  •  
    United States

Posted 03 August 2013 - 11:44 AM

The batch in that script won't break on certain media disks etc. as other batches will and has proven very reliable for me and others.



#15 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 03 August 2013 - 12:17 PM

I looked for and did not see the utility you mentioned(I'll be looking into that). Anyway found a post (I think by MedEvil) where in he was trying to figure out how thing loaded up and he found exactly the order and so on, anyway autorun.cmd for the win it loads after PEnetworking but before your twiddling your thumbs for any length of time i.e. perfection!



#16 muggles

muggles

    Newbie

  • Members
  • 24 posts
  • Location:New Orleans
  •  
    United States

Posted 03 August 2013 - 12:22 PM

wow, you must be using a really old version. it's been there for a while and for sure is in the 5-24-2013 release here: spam.net



#17 muggles

muggles

    Newbie

  • Members
  • 24 posts
  • Location:New Orleans
  •  
    United States

Posted 03 August 2013 - 12:25 PM

see private message. some people just need to grow up.



#18 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 03 August 2013 - 01:30 PM

I got your message and I see it there, upon review it is in winbuilder but it was unticked when I checked it out I remembered it as one I didnt think I'd use. Oh well, but it is in winbuilder!



#19 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 04 August 2013 - 10:58 PM

Does there exist a way to write a conditional bat file that uses the 'ver' command or something like it to check the windows and architecture of the windows installed on a system so that if you're in a 64 bit PE3 and the machine has has win7 64 bit then you have it install drivers from host else have it install drivers from driver pack, or if your in 32 bit PE3 and the host is 32bit win7 then host drivers are installed else driver pack.

The bat I have run at startup right now just does driver pack and when I tested it on my laptop (after perfecting everything else in VMware) everything seem to work perfectly until I realized that I had to manually install my wifi adapter (not a big deal but inconvient) and this seems like it would be an ideal solution.

#20 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 August 2013 - 10:45 AM

The "simplest" could be something *like*:

@ECHO OFF
pushd C:\programfiles(x86)\ 2>nul && GOTO :x64
:x32
popd
::Whatever is appropriate for 32 bit
GOTO :EOF
:x64
popd
::Whatever is appropriate for 64 bit
GOTO :EOF

:cheers:

Wonko



#21 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 05 August 2013 - 02:14 PM

Thank you wonko, awesome place for me to start, now I just need to tweak it so that it also knows its not xp as the drivers are diffrent (and research those commands as they are new to me)



#22 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 05 August 2013 - 02:56 PM

Based on wonko's suggestion I came up with this (removing the double colon infront of the commands as appropriate for the given setup(one bat 2 seprate builds(x64 & x86) just a diffrent colon to erase)). I don't know if the "IF EXSIST" function will work on a directory instead of a file (I only learned how to use it a week ago). Dunno if this will work, will be testing soon though, if anything jumps out as wrong let me know.

for %%a in ( b c d e f g h i j k l m n o p q r s t u v w y z) do (
IF EXIST %%a:\windows\ set Dir=%%a:)
pushd "%dir%\Documents and Settings\" 2>nul && GOTO :old
popd
pushd "%dir%\program files (x86)\" 2>nul && GOTO :x64
:x32
popd
::Whatever is appropriate for 32 bit
::X:\Windows\System32\dpinstL.exe /f:"\DriverPacks" /s
::X:\Windows\System32\dpinstL.exe /w /s
GOTO :EOF
:x64
popd
::Whatever is appropriate for 64 bit
::X:\Windows\System32\dpinstL.exe /f:"\DriverPacks" /s
::X:\Windows\System32\dpinstL.exe /w /s
GOTO :EOF
:old
popd
X:\Windows\System32\dpinstL.exe /f:"\DriverPacks" /s
GOTO :EOF
:EOF

removed the echo off as this particular bat gets called by another that already does that.



#23 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 05 August 2013 - 03:01 PM

I know vista drivers are for all intents and purposes the same as 7 drivers, I havent looked into 8 but I am assuming this is also true or this will have to be made more robust else bsod from bad drivers may occur.


Edited by tblo, 05 August 2013 - 03:02 PM.


#24 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 August 2013 - 04:00 PM

This:

for %%a in ( b c d e f g h i j k l m n o p q r s t u v w y z) do ( IF EXIST %%a:\windows\ set Dir=%%a:) 

though widely used, is NOT a particularly smart way to enumerate drive letters (and it can have some issues).

See here (JFYI):
http://www.msfn.org/...image/?p=895284

http://www.msfn.org/...72#entry1005836

 

IF EXIST in itself does work on directories, though there is the above issue with Removable cards (but that is because a device has a drive letter but not a volume/filesystem) and - only to let you know - it may have some issues in some rare cases, checking for the "nul" device is considered "better" and/or for the "nul.ext" one, :

http://www.msfn.org/...ch-programming/

http://www.msfn.org/...ure-and-append/

 

:cheers:

Wonko

 

 

 

 



#25 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 05 August 2013 - 04:38 PM

In a test run on my lappy witch I edited if exists to look for ntdll.dll under system32 just because I didn't trust it w/o a file. My attempt to discover windows xp failed because apparently though not visible nor accessible documents and setting does exist in current windows, your code works perfectly though.


Though it seems pcw.sys that gets installed from my host os makes PE3 bsod (twice in a row now 1ce well midway through typing this reply)... Wonder if there is a way to tell it "load drivers from PC but skip this one"




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users