Update: I've slightly modified my Presetup.cmd code in order to eliminate Issue No 1 - the code now will keep randomizing the Archive folder's name until it finds one which doesn't already exist (in case you left your previous Archive folder on the root directory before the reinstall).
I've also researched a bit Issue No 2 (the only issue remained) - the sharedaccess.ini showing up in All Users.WINDOWS instead of All Users directory. I think I have to find another way of setting the ALLUSERSPROFILE environment variable in my script other than by using the SET command which doesn't change it permanently.
1 2009-01-16 08:27:53
Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa (17 replies, posted in Feedback and Support - DriverPacks Base)
2 2009-01-14 19:08:12
Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa (17 replies, posted in Feedback and Support - DriverPacks Base)
Thank you, I think I understand now and I tried to correct the nomenclature again. If there are still errors please point them out.
3 2009-01-14 05:02:26
Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa (17 replies, posted in Feedback and Support - DriverPacks Base)
Thank you all the feedback, I've updated the HOWTO a bit. I've experimented with Repair Install years ago - but I always prefer to start a new system clean and build it up from the basics (I do the same with Linux too) this way I always end up with a fast, reliable and stable system - with my nLited, DriverPacked and Winaddoned ~700 MB XP ISO I have very few post setup task to do anyway. I also don't like the .WINDOWS folders in my Documents and Settings, I prefer the defaults.
On Issue 2:
I've launced a start /wait cmd.exe process at the beginning of Presetup.cmd and from there I could map the environment in which my script needs to work. According to this as soon as the WinPE starts, you have \Windows filled with system files and setup components, two empty directories \Documents and Settings\All Users and Default User, %ALLUSERSPROFILE% set to \Documents and Settings\All Users (or All Users.WINDOWS if Documents and Settings was already present when the WinPE stage started) and the 2 reg keys for AllUsersProfile & DefaultUserProfile already created.
Anybody could explain me why I still get sharedaccess.ini in the wrong place (All Users.WINDOWS) after the process even if I set the registry keys/env variables in my script? Is there any other reference which I don't know about or it's a "feature" ?
4 2009-01-12 08:15:07
Re: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa (17 replies, posted in Feedback and Support - DriverPacks Base)
Thank you Smartepants.
5 2009-01-12 03:31:32
Topic: HOWTO Reinstall Windows XP preserving personal data using DP BASE - pa (17 replies, posted in Feedback and Support - DriverPacks Base)
HOWTO: Reinstall Windows XP preserving user data - parallel installation without a mess
Situation:
you have to reinstall Windows XP on a hard disk already containing a previous Windows XP and you can't backup your personal data because:
-you haven't partitioned the disk as C: for Windows and programs and D: for all personal data
-your previous Windows XP is corrupted and unable to boot
-don't want to write a bunch of backup DVDs and don't have an external USB HDD
NOTE: I've applied the process 10-20 times on different systems without any problem - nevertheless backing up your most critical personal data before the reinstallation is highly advised - I cannot take any responsibility if you mess up something or loose any of your data
What can you do:
-you can do a Repair Install - if you ever tried this you know that this sometimes just messes things up
-repartition or reformat your drive - you will get a clean Windows XP system but loose all your personal data
-leave the filesystem intact (aka parallel installation) - but this way you will get a multiboot setup, the new system goes under \WINDOWS.0, and there will be All Users.WINDOWS and Default User.WINDOWS folders under Documents and Settings, and your Program Files folder will be a mess
OR
-modified parallel installation: boot with BartPE, UBCD4WIN or a Linux Live CD with NTFS write support, delete \WINDOWS, \Program Files and rename \Documents and Settings to e.g. \Archive and after this preparation you launch your Windows XP Setup CD and choose Leave Filesystem Intact instead of partitioning&formatting - the setup process will do a clean install and leave your files unharmed on the disk. I'll show you how to do this in an unattended way.
The unattended way:
1. you can use nLite to modify your setup source and apply your favourite tweaks (http://www.nliteos.com/) (OPTIONAL)
2. after nLite but before the ISO creation slipstream drivers to your source with DriverPacks BASE (http://driverpacks.net/) This is a necessary step (and above that useful too - I always slipstream drivers to my source with Driverpacks so I don't have to hunt for drivers after the install) because we will take advantage of DriverPacks method 2 tweak. If you don't want to slipstream drivers I suggest you run DriverPacks BASE and slipstream the CPU drivers only - it takes on a few Kb of space in your source.
3. after DriverPacks BASE finished the slipstreaming process it will replace the original SETUP.EXE (which is called during the WinPE Phase of the setup process) with its own Fake SETUP.EXE. The DriverPacks Fake Setup calls the DriverPacks PreSetup.cmd. PreSetup unpacks the drivers from the CD to the hard disk and then it calls the original SETUP.EXE which then proceeds with the normal XP setup. We will modify this PreSetup.cmd with our batch commands taking advantage of that it gets called at the most appropiate moment of the setup process: the start of the WinPE stage which is between the text mode setup and the Gui Phase. So we integrate the following lines at the start of the PreSetup.cmd (you can find it in the I386 folder of the source)
IF NOT EXIST "%SYSTEMDRIVE%\Program Files" GOTO PRESETUP
CD %SYSTEMDRIVE%\
RD /Q /S "%SYSTEMDRIVE%\Program Files"
RD /Q /S "%SYSTEMDRIVE%\Documents and Settings\All Users"
RD /Q /S "%SYSTEMDRIVE%\Documents and Settings\Default User"
RD /Q /S "%SYSTEMDRIVE%\Documents and Settings\LocalService"
RD /Q /S "%SYSTEMDRIVE%\Documents and Settings\NetworkService"
RD /Q /S "%SYSTEMDRIVE%\Documents and Settings\All Users.WINDOWS"
RD /Q /S "%SYSTEMDRIVE%\Documents and Settings\Default User.WINDOWS"
:RANDOMIZE
SET BACKUPDIR=Archive.%RANDOM%
IF EXIST %SYSTEMDRIVE%\%BACKUPDIR% GOTO RANDOMIZE
RENAME "%SYSTEMDRIVE%\Documents and Settings" %BACKUPDIR%
MKDIR "%SYSTEMDRIVE%\Documents and Settings\All Users"
MKDIR "%SYSTEMDRIVE%\Documents and Settings\Default User"
REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList" /v "AllUsersProfile" /d "All Users" /f
REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList" /v "DefaultUserProfile" /d "Default User" /f
REM FIXME <please see Issues section below> SET ALLUSERSPROFILE%="%SYSTEMDRIVE%\Documents and Settings\All Users"
:PRESETUP
...
<and here comes the contents of the original PreSetup.cmd>
...
What these script does is first it checks for the existence of "C:\Program Files" if this exists it assumes that a previous Windows installation is on the hard disk so it cleans up the Documents and Settings folder and renames it to Archive.<somerandomnumber>. After that we create the new empty Documents and Settings directory with All Users and Default User in it then we set the registry and the environment to point to these folders. When the setup process continues it won't have knowledge about the previous system installed on the same disk and this way we will get a fresh new installed system with our personal files backed up in the C:\Archive.<somerandomnumber> from where we can copy back our files to wherever we want them to be. We create a random folder for the backup in case there would already be an Archive folder in C:\.
4. Before creating our Setup CD ISO you also need to alter the contents of the I386/WinNT.sif file. You need to set the TargetPath variable under the [Unattended] section if it isn't already there like this:
[Unattended]
TargetPath="\WINDOWS"
This is necessary because if you don't set this variable the installation will take place under "\WINDOWS.0" folder if there's already a \WINDOWS directory on the partition from the previous system.
5. After that you can create your ISO from the source, burn it and pop it in for a nice Windows XP installation without losing your precious personal data on the partition.
Usage:
1. Boot from the Setup CD.
2. When Text Mode lists your partitions to choose for the new Windows install, choose the one where your old XP is already installed.
3. Select Keep the filesystem intact option.
4. Setup will ask you if it should delete the previous Windows installation, answer yes to that (L key).
5. Setup deletes your old \WINDOWS directory and create a new one for the new system.
6. After the reboot, our modded Presetup.cmd gets called which backs up the previous Documents and Settings and creates a new empty one.
7. The setup process continues further as normally would.
Issues:
Only one minor issue remained - after the setup process finishes I always end up with sharedaccess.ini placed inside C:\Documents and Settings\All Users.WINDOWS\Application Data\Microsoft\Network\Connections\Pbk instead of the normal C:\Documents and Settings\All Users\... place.
I believe this happens because ALLUSERSPROFILE is set to \Documents and Settings\All Users.WINDOWS by the setup process if you have a Documents and Settings folder already on the %SYSTEMDRIVE%. Unfortunately the SET command from my script (now REMmed out in the code) doesn't help in redefining this environment variable permanently because in WinPE it won't change ALLUSERSPROFILE globally - when PreSetup.cmd finishes it returns to All Users.WINDOWS. Anybody know a way to change it permanently?
Any feedback welcomed!