joefitzgerald / packer-windows

Windows Packer Templates
MIT License
1.63k stars 1.12k forks source link

Internet Explorer can't open while User Account Control is turned off #255

Open larytet opened 6 years ago

larytet commented 6 years ago

In Windows 8 I experience this problem

screenshot from 2017-12-17 16-03-07

larytet commented 6 years ago

I expect this to fix the problem for Windows 8


diff --git a/answer_files/81/Autounattend.xml b/answer_files/81/Autounattend.xml
index 047df95..80f9b73 100644
--- a/answer_files/81/Autounattend.xml
+++ b/answer_files/81/Autounattend.xml
@@ -233,8 +233,13 @@
                     <Description>Disable Hibernation Mode</Description>
                 </SynchronousCommand>
                 <SynchronousCommand wcm:action="add">
-                    <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine>
+                    <CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f</CommandLine>
                     <Order>22</Order>
+                    <Description>Enable User Account Control</Description>
+                </SynchronousCommand>
+               <SynchronousCommand wcm:action="add">
+                    <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine>
+                    <Order>23</Order>
                     <Description>Disable password expiration for vagrant user</Description>
                 </SynchronousCommand>
                 <!-- WITHOUT WINDOWS UPDATES -->