vagrant-windows-sysprep 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2df8a8a18113901195e0aa019bc03a77aff26259c8db5e9b6ea6007f52885f51
4
- data.tar.gz: 4c6f69bcee969e681750372b3ead7f0e3018710d57e917a67e393300479fe218
3
+ metadata.gz: 8992237b7f51500d12a334f886c8c33a32a4504b326294cefac6e1eb299a8396
4
+ data.tar.gz: 764ddcf2e955a498404febb36353d9d2c32e2346c17e31aabe62d9f845349900
5
5
  SHA512:
6
- metadata.gz: 3715f58719f35db57da04c05ab36cc014ec3aab5bff5f09999e496c3d33d931c628adda47d92b6ad38972ea5a47ea6cc09e10b4cae07b0c6008f82a5960c2090
7
- data.tar.gz: 5ad4390e3af22e74121273c8519bbb9ade57d9737f1661000f03e4861d0472efb584f52ba91e5673ed62ddbc5433a03db552160b4aed0170de337f93b5ba2d9b
6
+ metadata.gz: c7cd8cc24d09bdee2c0f2a7b8f4920c78e8e0a3eff728a4652a76ee5dcbf5a7206f035c8dadb924b146b9d9a8a24a9cfec5a5db80f8875a48b829462e09cff37
7
+ data.tar.gz: af43f8effba20ecd95cf855d23514b538a6f442031918e52e4a17f1eb7fd94a3e99f09636469c9ace964b0f78121fbbb71c2dcb63337cfa0403d196270213df1
@@ -130,10 +130,31 @@ Set-Content `
130
130
  -Value $unattendPs1
131
131
 
132
132
  Write-Host 'Syspreping...'
133
+ $sysprepSucceededTagPath = 'C:\Windows\System32\Sysprep\Sysprep_succeeded.tag'
134
+ # NB although sysprep is supposed to delete this, to be safe (e.g. earlier
135
+ # sysprep errors), delete it.
136
+ if (Test-Path $sysprepSucceededTagPath) {
137
+ Remove-Item -Force $sysprepSucceededTagPath
138
+ }
133
139
  C:/Windows/System32/Sysprep/sysprep.exe `
134
140
  /generalize `
135
141
  /oobe `
136
142
  /quiet `
137
- /shutdown `
143
+ /quit `
138
144
  "/unattend:$unattendPath" `
139
145
  | Out-String -Stream
146
+
147
+ Write-Host 'Checking for sysprep errors...'
148
+ if (!(Test-Path $sysprepSucceededTagPath)) {
149
+ Get-Content C:\Windows\System32\Sysprep\Panther\setuperr.log
150
+ throw "sysprep failed because no $sysprepSucceededTagPath file was found. for more details see the C:\Windows\System32\Sysprep\Panther\setupact.log file (and related files)."
151
+ }
152
+
153
+ Write-Host 'Ensuring the windows image state is IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE...'
154
+ $imageState = (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State).ImageState
155
+ if ($imageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') {
156
+ throw "the windows image state $imageState is not the expected IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE."
157
+ }
158
+
159
+ Write-Host 'Stopping computer...'
160
+ Stop-Computer -Force
@@ -9,8 +9,8 @@
9
9
  <SkipRearm>1</SkipRearm>
10
10
  </component>
11
11
  <component name="Microsoft-Windows-PnpSysprep" 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">
12
- <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
13
- <DoNotCleanUpNonPresentDevices>true</DoNotCleanUpNonPresentDevices>
12
+ <PersistAllDeviceInstalls>false</PersistAllDeviceInstalls>
13
+ <DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices>
14
14
  </component>
15
15
  </settings>
16
16
  <settings pass="specialize">
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module WindowsSysprep
3
- VERSION = "0.0.10"
3
+ VERSION = "0.0.11"
4
4
  end
5
5
  end
@@ -114,7 +114,7 @@ module VagrantPlugins
114
114
  options = {}
115
115
  options[:color] = color if !config.keep_color
116
116
 
117
- @machine.ui.info(data.chomp, options)
117
+ @machine.ui.info(data.chomp, **options)
118
118
  end
119
119
  end
120
120
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-windows-sysprep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rui Lopes
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-08-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -39,7 +38,6 @@ homepage: https://github.com/rgl/vagrant-windows-sysprep
39
38
  licenses:
40
39
  - LGPLv3
41
40
  metadata: {}
42
- post_install_message:
43
41
  rdoc_options: []
44
42
  require_paths:
45
43
  - lib
@@ -54,8 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
52
  - !ruby/object:Gem::Version
55
53
  version: '0'
56
54
  requirements: []
57
- rubygems_version: 3.1.2
58
- signing_key:
55
+ rubygems_version: 3.6.7
59
56
  specification_version: 4
60
57
  summary: Vagrant plugin for running Windows sysprep.
61
58
  test_files: []