Index: /trunk/src/VBox/Installer/common/unattended_templates/win_nt6_unattended.xml
===================================================================
--- /trunk/src/VBox/Installer/common/unattended_templates/win_nt6_unattended.xml	(revision 67882)
+++ /trunk/src/VBox/Installer/common/unattended_templates/win_nt6_unattended.xml	(revision 67883)
@@ -3,5 +3,5 @@
 
   <settings pass="windowsPE">
-    <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="$arch" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
+    <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="@@VBOX_INSERT_OS_ARCH_ATTRIB_DQ@@" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
       <InputLocale>en-US</InputLocale>
       <SystemLocale>en-US</SystemLocale>
@@ -10,5 +10,6 @@
     </component>
     
-    <component name="Microsoft-Windows-Setup" processorArchitecture="$arch" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
+    <component name="Microsoft-Windows-Setup" processorArchitecture="@@VBOX_INSERT_OS_ARCH_ATTRIB_DQ@@"
+      publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
 
       <DiskConfiguration>
@@ -25,47 +26,49 @@
         </CreatePartitions>
         </Disk>
-    </DiskConfiguration>
+      </DiskConfiguration>
 
-    <UserData>
-      <ProductKey>
-        <Key>$ProductKey</Key>
-        <WillShowUI>OnError</WillShowUI>
-      </ProductKey>
-      <AcceptEula>true</AcceptEula>
-    </UserData>
+      <UserData>
+        <ProductKey>
+          <Key>@@VBOX_INSERT_PRODUCT_KEY_ELEMENT@@</Key>
+          <WillShowUI>OnError</WillShowUI>
+        </ProductKey>
+        <AcceptEula>true</AcceptEula>
+      </UserData>
 
-    <ImageInstall>
-      <OSImage>
-        <InstallFrom>
-          <MetaData wcm:action="add">
-            <Key>IMAGE/INDEX</Key>
-            <Value>1</Value>
-          </MetaData>
-          <Path>d:\sources\install.wim</Path>
-        </InstallFrom>
-        <InstallTo>
-          <DiskID>0</DiskID>
-          <PartitionID>1</PartitionID>
-        </InstallTo>
-        <WillShowUI>OnError</WillShowUI>
-        <InstallToAvailablePartition>false</InstallToAvailablePartition>
-      </OSImage>
-    </ImageInstall>
-    
-    <ComplianceCheck>
-      <DisplayReport>OnError</DisplayReport>
-    </ComplianceCheck>
+      <ImageInstall>
+        <OSImage>
+          <InstallFrom>
+            <MetaData wcm:action="add">
+              <Key>IMAGE/INDEX</Key>
+              <Value>@@VBOX_INSERT_IMAGE_INDEX_ELEMENT@@</Value>
+            </MetaData>
+            <Path>d:\sources\install.wim</Path>
+          </InstallFrom>
+          <InstallTo>
+            <DiskID>0</DiskID>
+            <PartitionID>1</PartitionID>
+          </InstallTo>
+          <WillShowUI>OnError</WillShowUI>
+          <InstallToAvailablePartition>false</InstallToAvailablePartition>
+        </OSImage>
+      </ImageInstall>
+
+      <ComplianceCheck>
+        <DisplayReport>OnError</DisplayReport>
+      </ComplianceCheck>
+
     </component>
   </settings>
 
   <settings pass="oobeSystem">
-    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="$arch" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
+    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="@@VBOX_INSERT_OS_ARCH_ATTRIB_DQ@@"
+      publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
       <AutoLogon>
-      <Password>
-        <Value>$password</Value> 
-        <PlainText>true</PlainText>
-      </Password>
-      <Enabled>true</Enabled> 
-      <Username>$user</Username> 
+        <Password>
+          <Value>@@VBOX_INSERT_USER_PASSWORD_ELEMENT@@</Value>
+          <PlainText>true</PlainText>
+        </Password>
+        <Enabled>true</Enabled>
+        <Username>@@VBOX_INSERT_USER_LOGIN_ELEMENT@@</Username>
       </AutoLogon>
 
@@ -73,8 +76,8 @@
       <LocalAccounts>
         <LocalAccount wcm:action="add">
-        <Name>$user</Name>
+        <Name>@@VBOX_INSERT_USER_LOGIN_ELEMENT@@</Name>
         <Group>administrators;users</Group>
         <Password>
-          <Value>$password</Value>
+          <Value>@@VBOX_INSERT_USER_PASSWORD_ELEMENT@@</Value>
           <PlainText>true</PlainText>
         </Password>
@@ -101,4 +104,6 @@
           <CommandLine>cmd /c reg add "HKLM\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff"</CommandLine>
         </SynchronousCommand>
+@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
+<!-- TODO: The following two command can be combined. -->
         <SynchronousCommand wcm:action="add">
           <Order>2</Order>
@@ -111,4 +116,5 @@
           <CommandLine>e:\VBoxWindowsAdditions.exe /S</CommandLine>
         </SynchronousCommand>
+@@VBOX_COND_END@@
       </FirstLogonCommands>
 
Index: /trunk/src/VBox/Main/src-all/Global.cpp
===================================================================
--- /trunk/src/VBox/Main/src-all/Global.cpp	(revision 67882)
+++ /trunk/src/VBox/Main/src-all/Global.cpp	(revision 67883)
@@ -742,4 +742,5 @@
         case VERR_UNRESOLVED_ERROR:             return E_FAIL;
         case VERR_NOT_EQUAL:                    return VBOX_E_FILE_ERROR;
+        case VERR_FILE_NOT_FOUND:               return VBOX_E_OBJECT_NOT_FOUND;
 
         default:
