Jump to content

WPI with custom administrator account


Recommended Posts

I am trying to run WPI using an unattended install with an admin group account, but not the default administrator user account that comes built into vista. I put %appsroot%\wpi\wpi.hta in first logon commands, set appsroot to the location of appsroot.txt during the specialize pass and not the oobepass, and I set the autologon in oobepass to logon to the custom admin group account. Every time I boot into the account wpi does not run. I autolog into the account fine, but the wpi does not run. If I do a start->run, copy the line that runs from firstlogoncommand, and paste it into the run box, wpi loads, so I know the variable is fine.

I also tried adding a hklm/runonceex key during specialize so when the account is logged on it can run the %appsroot%\wpi\wpi.hta once. That didn't work either.

I was going to put it in setupcomplete.cmd and run it from there. The problem I have is in my regtweaks import I am rerouting the programfilespath for x86 and x64 to my d drive so when I install the programs from wpi they will install to the d: by default.

If I run the regtweaks from specialize and let setupcomplete.cmd run wpi after the install is done, will it default the programs to install to the d: for my custom admin account?

Ultimately what I am trying to do is add all the regtweaks to the default user and hklm prior to making a new account, then add the reg tweaks to the new account after it is made, then run wpi from the new account, but only when the registry keys are created for the new account (whether desktop is loaded or not does not matter to me), but it had to be for the new custom admin account only.

autounattend.xml

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>0409:00000409</InputLocale>
<UserLocale>en-US</UserLocale>
<UILanguage>en-US</UILanguage>
<SystemLocale>en-US</SystemLocale>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UserData>
<ProductKey>
<Key>KEY HERE</Key>
<WillShowUI>OnError</WillShowUI>
</ProductKey>
<AcceptEula>true</AcceptEula>
<FullName>Unknown User</FullName>
<Organization>Unknown Org</Organization>
</UserData>
<ImageInstall>
<OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/NAME</Key>
<Value>Windows 7 ULTIMATE</Value>
</MetaData>
</InstallFrom>
<InstallToAvailablePartition>false</InstallToAvailablePartition>
<WillShowUI>OnError</WillShowUI>
</OSImage>
</ImageInstall>
<EnableFirewall>false</EnableFirewall>
<EnableNetwork>true</EnableNetwork>
<Display>
<ColorDepth>32</ColorDepth>
<HorizontalResolution>1024</HorizontalResolution>
<VerticalResolution>768</VerticalResolution>
</Display>
<DiskConfiguration>
<WillShowUI>Always</WillShowUI>
</DiskConfiguration>
<ComplianceCheck>
<DisplayReport>OnError</DisplayReport>
</ComplianceCheck>
<LogPath></LogPath>
<UseConfigurationSet>true</UseConfigurationSet>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OOBE>
<HideEULAPage>true</HideEULAPage>
<NetworkLocation>Home</NetworkLocation>
<HideWirelessSetupInOOBE>false</HideWirelessSetupInOOBE>
<ProtectYourPC>3</ProtectYourPC>
<SkipMachineOOBE>false</SkipMachineOOBE>
<SkipUserOOBE>true</SkipUserOOBE>
</OOBE>
<TimeZone>Eastern Standard Time</TimeZone>
<AutoLogon>
<Password>
<Value>cABhAHMAcwB3AG8AcgBkAFAAYQBzAHMAdwBvAHIAZAA=</Value>
<PlainText>false</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>2</LogonCount>
<Username>Unknown User</Username>
</AutoLogon>
<Display>
<ColorDepth>32</ColorDepth>
<DPI>96</DPI>
<HorizontalResolution>1024</HorizontalResolution>
<VerticalResolution>768</VerticalResolution>
</Display>
<VisualEffects>
<FontSmoothing>ClearType</FontSmoothing>
</VisualEffects>
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<BluetoothTaskbarIconEnabled>false</BluetoothTaskbarIconEnabled>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>cABhAHMAcwB3AG8AcgBkAFAAYQBzAHMAdwBvAHIAZAA=</Value>
<PlainText>false</PlainText>
</Password>
<Name>Unknown User</Name>
<DisplayName>Unknown User</DisplayName>
<Group>Administrators</Group>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<CommandLine>cmd /c REGEDIT /S %AppsRoot%\WPI\Install\Tweaks.reg</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
</component>
<component name="Microsoft-Windows-Sidebar" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SidebarOnByDefault>false</SidebarOnByDefault>
<SidebarVisible>false</SidebarVisible>
</component>
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>0409:00000409</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>en-US</UserLocale>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<component name="Security-Malware-Windows-Defender" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DisableAntiSpyware>true</DisableAntiSpyware>
</component>
<component name="Microsoft-Windows-RemoteAssistance-Exe" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<fAllowToGetHelp>false</fAllowToGetHelp>
</component>
<component name="Microsoft-Windows-Security-Licensing-SLC-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DoNotCleanTaskBar>false</DoNotCleanTaskBar>
<TimeZone>Eastern Standard Time</TimeZone>
<CopyProfile>false</CopyProfile>
<ComputerName>*</ComputerName>
</component>
<component name="Microsoft-Windows-SQMApi" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CEIPEnabled>0</CEIPEnabled>
</component>
<component name="Microsoft-Windows-SystemRestore-Main" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DisableSR>1</DisableSR>
</component>
<component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DomainProfile_EnableFirewall>false</DomainProfile_EnableFirewall>
<PrivateProfile_EnableFirewall>false</PrivateProfile_EnableFirewall>
<PublicProfile_EnableFirewall>false</PublicProfile_EnableFirewall>
<PublicProfile_DisableNotifications>true</PublicProfile_DisableNotifications>
</component>
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>cmd /c "FOR %i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %i:\AppsRoot.txt SETX AppsRoot %i: -m"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Path>cmd /c REGEDIT /S %AppsRoot%\WPI\Install\Tweaks.reg</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
<settings pass="generalize">
<component name="Microsoft-Windows-SharedAccess" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<EnableICS>false</EnableICS>
</component>
</settings>
<cpi:offlineImage cpi:source="catalog:z:/vistawork/dvd/sources/install_windows 7 ultimate.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

setupcomplete.cmd

@ECHO OFF
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /V "Disable Script Debugger" /T "REG_SZ" /D "no" /F
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /V "DisableScriptDebuggerIE" /T "REG_SZ" /D "no" /F
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\sources\install.wim set CDROM=%%i:
Start "" /MIN /WAIT %windir%\setup\scripts\RunOnceEx.cmd
shutdown /r /t 0

runonceex.cmd

@echo off
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\sources\install.wim set CDROM=%%i:
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY%\030 /VE /D "Running WPI" /f
REG ADD %KEY%\030 /V 1 /D "%cdrom%\wpi\wpi.exe" /f

EXIT

One of the tweaks in the registry in the specialized pass and firstlogoncommands (same reg file)is to change the programfilespath to d:\program files for the 64 bit and d:\program files (x86) for the 32 bit. The registry changes are there when the wpi runs from the runonceex. But when I install everything using the %programfiles% variable, it still installs everything to the c:. The account is auto logon. If I manually log out and log back in inputting the password for the account and run wpi, the programs now install to the d:.

I want the autounattend to load to the account, run wpi, and have the default programfiles path be the d:. Any ideas. Should I import the regtweaks during the specialized pass and the setupcomplete.cmd and remove it from the first logon? It seems the programfiles path is not being changed in the specialized pass and only in the first logon, which means the programsfiles path will not take effect until I do the manual logoff and login of the account....?

Edited by boricua1111
Link to comment
Share on other sites


Nevermind. I figured out the issue. I forgot the HLKM effects are applied on a reboot. Below is how I fixed the issue. These are all being done in setupcomplete.cmd

1 - apply registry tweaks to redirect programfiles path.

2 - Apply registry tweaks to call wpi.exe in runonceex.

3 - reboot the machine using the shutdown -r -t 0 command.

When the machine reboots the autounattend has the autologon setup so I can log into the account, then the runonceex runs the wpi.exe. when I pick the programs to install, they default to programfilespath, which is now on my d drive.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...