Index: /trunk/src/VBox/Main/UnattendedTemplates/win_nt6_unattended.xml
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/win_nt6_unattended.xml	(revision 68221)
+++ /trunk/src/VBox/Main/UnattendedTemplates/win_nt6_unattended.xml	(revision 68222)
@@ -8,8 +8,8 @@
             publicKeyToken="31bf3856ad364e35" language="neutral"
             versionScope="nonSxS">
-            <InputLocale>en-US</InputLocale>
-            <SystemLocale>en-US</SystemLocale>
-            <UILanguage>en-US</UILanguage>
-            <UserLocale>en-US</UserLocale>
+            <InputLocale>@@VBOX_INSERT_DASH_LOCALE@@</InputLocale>
+            <SystemLocale>@@VBOX_INSERT_DASH_LOCALE@@</SystemLocale>
+            <UILanguage>@@VBOX_INSERT_DASH_LOCALE@@</UILanguage>
+            <UserLocale>@@VBOX_INSERT_DASH_LOCALE@@</UserLocale>
         </component>
 
@@ -117,4 +117,5 @@
                 <SkipUserOOBE>true</SkipUserOOBE>
                 <SkipMachineOOBE>true</SkipMachineOOBE>
+                <!-- Make this (NetworkLocation) default to public and make it configurable -->
                 <NetworkLocation>Home</NetworkLocation>
             </OOBE>
@@ -129,11 +130,12 @@
                     <Order>2</Order>
                     <Description>VirtualBox post guest install steps </Description>
-                    <CommandLine>cmd.exe /c A:\vboxpostinstall.cmd</CommandLine>
+                    <CommandLine>cmd.exe /c A:\VBOXPOST.CMD</CommandLine>
                 </SynchronousCommand>
             </FirstLogonCommands>
 
-            <TimeZone>GMT Standard Time</TimeZone>
+            <TimeZone>@@VBOX_INSERT_TIME_ZONE_WIN_NAME@@</TimeZone>
         </component>
 
     </settings>
 </unattend>
+
Index: /trunk/src/VBox/Main/UnattendedTemplates/win_postinstall.cmd
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/win_postinstall.cmd	(revision 68221)
+++ /trunk/src/VBox/Main/UnattendedTemplates/win_postinstall.cmd	(revision 68222)
@@ -20,10 +20,128 @@
 rem
 
+rem Globals.
+set MY_LOG_FILE=C:\vboxpostinstall.log
 
-echo TODO
+rem Log header.
+echo *** started >> %MY_LOG_FILE%
+echo *** CD=%CD% >> %MY_LOG_FILE%
+echo *** Environment BEGIN >> %MY_LOG_FILE%
+set >> %MY_LOG_FILE%
+echo *** Environment END >> %MY_LOG_FILE%
+
 
 @@VBOX_COND_IS_INSTALLING_ADDITIONS@@
-e:\cert\VBoxCertUtil.exe add-trusted-publisher e:\cert\vbox*.cer --root e:\cert\vbox*.cer
-e:\VBoxWindowsAdditions.exe /S
+rem
+rem Install the guest additions.
+rem
+
+rem First find the CDROM with the GAs on them.
+set MY_VBOX_ADDITIONS=E:\vboxadditions
+if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
+set MY_VBOX_ADDITIONS=D:\vboxadditions
+if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
+set MY_VBOX_ADDITIONS=F:\vboxadditions
+if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
+set MY_VBOX_ADDITIONS=G:\vboxadditions
+if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
+set MY_VBOX_ADDITIONS=E:
+if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
+set MY_VBOX_ADDITIONS=F:
+if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
+set MY_VBOX_ADDITIONS=G:
+if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
+set MY_VBOX_ADDITIONS=D:
+if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
+set MY_VBOX_ADDITIONS=E:\vboxadditions
+:found_vbox_additions
+echo *** MY_VBOX_ADDITIONS=%MY_VBOX_ADDITIONS%\ >> %MY_LOG_FILE%
+
+rem Then add signing certificate to trusted publishers
+echo *** Running: %MY_VBOX_ADDITIONS%\cert\VBoxCertUtil.exe ... >> %MY_LOG_FILE%
+%MY_VBOX_ADDITIONS%\cert\VBoxCertUtil.exe add-trusted-publisher %MY_VBOX_ADDITIONS%\cert\vbox*.cer --root %MY_VBOX_ADDITIONS%\cert\vbox*.cer >> %MY_LOG_FILE% 2>&1
+echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
+
+rem Then do the installation.
+echo *** Running: %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe /S >> %MY_LOG_FILE%
+%MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe /S
+echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
+
 @@VBOX_COND_END@@
 
+
+@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@
+rem
+rem Install the Test Execution service
+rem
+
+rem First find the CDROM with the validation kit on it.
+set MY_VBOX_VALIDATION_KIT=E:\vboxvalidationkit
+if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
+set MY_VBOX_VALIDATION_KIT=D:\vboxvalidationkit
+if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
+set MY_VBOX_VALIDATION_KIT=F:\vboxvalidationkit
+if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
+set MY_VBOX_VALIDATION_KIT=G:\vboxvalidationkit
+if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
+set MY_VBOX_VALIDATION_KIT=E:
+if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
+set MY_VBOX_VALIDATION_KIT=F:
+if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
+set MY_VBOX_VALIDATION_KIT=G:
+if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
+set MY_VBOX_VALIDATION_KIT=D:
+if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
+set MY_VBOX_VALIDATION_KIT=E:\vboxvalidationkit
+:found_vbox_validation_kit
+echo *** MY_VBOX_VALIDATION_KIT=%MY_VBOX_VALIDATION_KIT%\ >> %MY_LOG_FILE%
+
+rem Copy over the files.
+echo *** Running: mkdir %SystemDrive%\Apps >> %MY_LOG_FILE%
+mkdir %SystemDrive%\Apps >> %MY_LOG_FILE% 2>&1
+echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
+
+echo *** Running: copy %MY_VBOX_VALIDATION_KIT%\win\* %SystemDrive%\Apps >> %MY_LOG_FILE%
+copy %MY_VBOX_VALIDATION_KIT%\win\* %SystemDrive%\Apps >> %MY_LOG_FILE% 2>&1
+echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
+
+echo *** Running: copy %MY_VBOX_VALIDATION_KIT%\win\%PROCESSOR_ARCHITECTURE%\* %SystemDrive%\Apps >> %MY_LOG_FILE%
+copy %MY_VBOX_VALIDATION_KIT%\win\%PROCESSOR_ARCHITECTURE%\* %SystemDrive%\Apps >> %MY_LOG_FILE% 2>&1
+echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
+
+rem Update the registry to autorun the service and make sure we've got autologon.
+echo *** Running: reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NTConfiguration /d %SystemDrive%\Apps\vboxtxs.cmd >> %MY_LOG_FILE%
+reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NTConfiguration /d %SystemDrive%\Apps\vboxtxs.cmd >> %MY_LOG_FILE% 2>&1
+echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
+
+echo *** Running: reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v PowerdownAfterShutdown /d 1 >> %MY_LOG_FILE%
+reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v PowerdownAfterShutdown /d 1 >> %MY_LOG_FILE% 2>&1
+echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
+
+echo *** Running: reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v ForceAutoLogon /d 1 >> %MY_LOG_FILE%
+reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v ForceAutoLogon /d 1 >> %MY_LOG_FILE% 2>&1
+echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
+rem  AutoAdminLogon too if administrator?
+
+rem Configure the firewall to allow TXS to listen.
+echo *** Running: netsh firewall add portopening TCP 5048 "TestExecService 5048" >> %MY_LOG_FILE%
+netsh firewall add portopening TCP 5048 "TestExecService 5048" >> %MY_LOG_FILE% 2>&1
+echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
+
+echo *** Running: netsh firewall add portopening TCP 5042 "TestExecService 5042" >> %MY_LOG_FILE%
+netsh firewall add portopening TCP 5042 "TestExecService 5042" >> %MY_LOG_FILE% 2>&1
+echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
+
+@@VBOX_COND_END@@
+
+
+@@VBOX_COND_HAS_POST_INSTALL_COMMAND@@
+rem
+rem Run user command.
+rem
+echo *** Running custom user command ... >> %MY_LOG_FILE%
+echo *** Running: "@@VBOX_INSERT_POST_INSTALL_COMMAND@@" >> %MY_LOG_FILE%
+@@VBOX_INSERT_POST_INSTALL_COMMAND@@
+@@VBOX_COND_END@@
+
+echo *** done >> %MY_LOG_FILE%
+
Index: /trunk/src/VBox/Main/include/UnattendedInstaller.h
===================================================================
--- /trunk/src/VBox/Main/include/UnattendedInstaller.h	(revision 68221)
+++ /trunk/src/VBox/Main/include/UnattendedInstaller.h	(revision 68222)
@@ -110,4 +110,5 @@
     virtual HRESULT initInstaller();
 
+#if 0 /* These are now in the AUX VISO. */
     /**
      * Whether the VBox guest additions ISO is needed or not.
@@ -125,4 +126,5 @@
      */
     virtual bool isValidationKitIsoNeeded() const;
+#endif
 
     /**
@@ -139,5 +141,12 @@
      * Indicates whether an additional or replacement ISO image is needed or not.
      */
-    virtual bool isAuxiliaryIsoNeeded() const       { return false; }
+    virtual bool isAuxiliaryIsoNeeded() const;
+
+    /**
+     * Indicates whether we should boot from the auxiliary ISO image.
+     *
+     * Will boot from installation ISO if false.
+     */
+    virtual bool bootFromAuxiliaryIso() const       { return isAuxiliaryIsoNeeded(); }
 
     /**
@@ -149,5 +158,5 @@
      * be remastered with small changes and additions.
      */
-    virtual bool isAuxiliaryIsoIsVISO() const       { return false; }
+    virtual bool isAuxiliaryIsoIsVISO() const       { return true; }
 
     /*
@@ -355,9 +364,11 @@
         : UnattendedInstaller(pParent,
                               "win_nt5_unattended.sif", "win_postinstall.cmd",
-                              "WINNT.SIF",              "vboxpostinstall.cmd")
-    { Assert(isOriginalIsoNeeded()); Assert(isAuxiliaryFloppyNeeded());  Assert(!isAuxiliaryIsoNeeded()); }
+                              "WINNT.SIF",              "VBOXPOST.CMD")
+    { Assert(isOriginalIsoNeeded()); Assert(isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); Assert(!bootFromAuxiliaryIso()); }
     ~UnattendedWindowsSifInstaller()        {}
 
     bool isAuxiliaryFloppyNeeded() const    { return true; }
+    bool bootFromAuxiliaryIso() const       { return false; }
+
 };
 
@@ -371,9 +382,10 @@
         : UnattendedInstaller(pParent,
                               "win_nt6_unattended.xml", "win_postinstall.cmd",
-                              "autounattend.xml",       "vboxpostinstall.cmd")
-    { Assert(isOriginalIsoNeeded()); Assert(isAuxiliaryFloppyNeeded());  Assert(!isAuxiliaryIsoNeeded()); }
+                              "autounattend.xml",       "VBOXPOST.CMD")
+    { Assert(isOriginalIsoNeeded()); Assert(isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); Assert(!bootFromAuxiliaryIso()); }
     ~UnattendedWindowsXmlInstaller()      {}
 
     bool isAuxiliaryFloppyNeeded() const    { return true; }
+    bool bootFromAuxiliaryIso() const       { return false; }
 };
 
@@ -399,5 +411,4 @@
 
     bool isAuxiliaryIsoNeeded() const       { return true; }
-    bool isAuxiliaryIsoIsVISO() const       { return true; }
 
 protected:
Index: /trunk/src/VBox/Main/src-server/UnattendedImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/UnattendedImpl.cpp	(revision 68221)
+++ /trunk/src/VBox/Main/src-server/UnattendedImpl.cpp	(revision 68222)
@@ -826,8 +826,10 @@
     if (mpInstaller->isOriginalIsoNeeded())
         cDvdDrivesNeeded++;
+#if 0 /* These are now in the AUX VISO. */
     if (mpInstaller->isAdditionsIsoNeeded())
         cDvdDrivesNeeded++;
     if (mpInstaller->isValidationKitIsoNeeded())
         cDvdDrivesNeeded++;
+#endif
     Assert(cDvdDrivesNeeded > 0);
     if (cDvdDrivesNeeded > lstControllerDvdSlots.size())
@@ -878,10 +880,9 @@
      * Prepare ISO mounts.
      *
-     * ASSUMES the auxiliary ISO is bootable if present.  ASSUMES the original
-     * ISO is bootable if no auxiliary ISO present.  These two assumptions is
-     * reflected in the order we grab DVD slots.
+     * Boot order depends on bootFromAuxiliaryIso() and we must grab DVD slots
+     * according to the boot order.
      */
     std::list<ControllerSlot>::const_iterator itDvdSlot = lstControllerDvdSlots.begin();
-    if (mpInstaller->isAuxiliaryIsoNeeded())
+    if (mpInstaller->isAuxiliaryIsoNeeded() && mpInstaller->bootFromAuxiliaryIso())
     {
         rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, mpInstaller->getAuxiliaryIsoFilePath()));
@@ -895,4 +896,11 @@
     }
 
+    if (mpInstaller->isAuxiliaryIsoNeeded() && !mpInstaller->bootFromAuxiliaryIso())
+    {
+        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, mpInstaller->getAuxiliaryIsoFilePath()));
+        ++itDvdSlot;
+    }
+
+#if 0 /* These are now in the AUX VISO. */
     if (mpInstaller->isAdditionsIsoNeeded())
     {
@@ -906,4 +914,5 @@
         ++itDvdSlot;
     }
+#endif
 
     return S_OK;
Index: /trunk/src/VBox/Main/src-server/UnattendedInstaller.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/UnattendedInstaller.cpp	(revision 68221)
+++ /trunk/src/VBox/Main/src-server/UnattendedInstaller.cpp	(revision 68222)
@@ -187,4 +187,5 @@
 }
 
+#if 0  /* Always in AUX ISO */
 bool UnattendedInstaller::isAdditionsIsoNeeded() const
 {
@@ -198,4 +199,14 @@
     return !isAuxiliaryIsoIsVISO() && mpParent->i_getInstallTestExecService();
 }
+#endif
+
+bool UnattendedInstaller::isAuxiliaryIsoNeeded() const
+{
+    /* In the VISO case we use the AUX ISO for GAs and TXS. */
+    return isAuxiliaryIsoIsVISO()
+        && (   mpParent->i_getInstallGuestAdditions()
+            || mpParent->i_getInstallTestExecService());
+}
+
 
 HRESULT UnattendedInstaller::prepareUnattendedScripts()
Index: /trunk/src/VBox/Main/src-server/UnattendedScript.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/UnattendedScript.cpp	(revision 68221)
+++ /trunk/src/VBox/Main/src-server/UnattendedScript.cpp	(revision 68222)
@@ -559,4 +559,10 @@
     else if (IS_PLACEHOLDER_MATCH("LOCALE"))
         rValue = mpUnattended->i_getLocale();
+    else if (IS_PLACEHOLDER_MATCH("DASH_LOCALE"))
+    {
+        rValue = mpUnattended->i_getLocale();
+        Assert(rValue[2] == '_');
+        rValue.replace(2, 1, "-");
+    }
     else if (IS_PLACEHOLDER_MATCH("COUNTRY"))
         rValue = mpUnattended->i_getCountry();
