Skip to content

Commit 446b056

Browse files
authored
Merge pull request #38 from SvenGroot/v2.1-dev
Merge v2.1 into main
2 parents 7cd0a6a + f9f3651 commit 446b056

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+272
-402
lines changed

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup .NET
2020
uses: actions/setup-dotnet@v4
2121
with:
22-
dotnet-version: 7.0.x
22+
dotnet-version: 9.0.x
2323
- name: Restore dependencies
2424
run: dotnet restore src
2525
- name: Build

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,21 @@ To provision a domain account for the computer, you can use the following comman
292292
djoin.exe /provision /domain domainname /machine machinename /savefile filename
293293
```
294294

295+
### Specifying a computer name
296+
297+
When you provide a computer name using the [`-ComputerName`][] argument, the Answer File Generator
298+
does not check whether that computer name is valid. Specifying an invalid computer name will cause
299+
Windows setup to fail when applying the answer file. Make sure you follow the
300+
[rules for computer names](https://learn.microsoft.com/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-computername)
301+
when choosing a name.
302+
303+
If you do not specify a computer name, Windows will automatically choose one during installation.
304+
In addition, you can also use the `#` character to generate a name containing a random number.
305+
306+
Every occurrence of `#` in the provided computer name will be replaced with a digit between 0 and 9
307+
when generating the answer file. For example `PC-###` would be replaced with `PC-123` (or some
308+
other random number).
309+
295310
## Using JSON to provide options
296311

297312
Because the large number of command line arguments may get unwieldy, the Answer File Generator
@@ -315,7 +330,7 @@ The core functionality for generating answer files is implemented in the
315330

316331
To build Answer File Generator, make sure you have the following installed:
317332

318-
- [Microsoft .Net 8.0 SDK](https://dotnet.microsoft.com/download) or later
333+
- [Microsoft .Net 9.0 SDK](https://dotnet.microsoft.com/download) or later
319334

320335
To build the application, library, and tests, simply use the `dotnet build` command in the `src`
321336
directory. You can run the unit tests using `dotnet test`.
@@ -338,6 +353,7 @@ any other adverse effects caused by the use of answer files generated by this to
338353
[`-AutoLogonUser`]: doc/CommandLine.md#-autologonuser
339354
[`-AutoLogonCount`]: doc/CommandLine.md#-autologoncount
340355
[`-Feature`]: doc/CommandLine.md#-feature
356+
[`-ComputerName`]: doc/CommandLine.md#-computername
341357
[`-FirstLogonCommand`]: doc/CommandLine.md#-firstlogoncommand
342358
[`-Install`]: doc/CommandLine.md#-install
343359
[`-InstallToDisk`]: doc/CommandLine.md#-installtodisk

doc/ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# What's new in Answer File Generator
22

3+
## Answer File Generator 2.1 (2025-03-09)
4+
5+
- You can now [generate computer names containing a random number](../README.md#specifying-a-computer-name),
6+
by using the `#` character in the name you provide.
7+
- Improved error messages for certain kinds of invalid JSON input.
8+
39
## Answer File Generator 2.0 (2024-10-07)
410

511
- The [`-DomainAccount`][] argument now allows you to specify users from different domains than the

doc/CommandLine.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,14 @@ Required argument: -JoinDomain
404404

405405
### `-ComputerName`
406406

407-
The network name for the computer. If not specified, Windows will generate a default name.
407+
The network name for the computer. If not specified, Windows will generate a default name. Any `#`
408+
characters in the name will be replaced with a random digit between 0 and 9. For example, `PC-###`
409+
would be replaced with `PC-123` (or some other random number).
408410

409411
Must not be blank.
410412

413+
See [specifying a computer name](../README.md#specifying-a-computer-name).
414+
411415
```yaml
412416
Value: <String>
413417
Alias: -n
@@ -485,7 +489,7 @@ See [first log-on commands and scripts](../README.md#first-log-on-commands-and-s
485489

486490
```yaml
487491
Value: <String> (multiple allowed)
488-
Aliases: -SetupScript, -s
492+
Alias: -s
489493
```
490494

491495
### `-Language`

doc/Library.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ Version 2.0 of the library has a few breaking changes from version 1.x:
5656
- The [`DomainOptionsBase.DomainAccounts`][] property has a different type.
5757
- The `AnswerFileOptions.SetupScripts` property was renamed to [`FirstLogonScripts`][].
5858

59-
[`AnswerFileGenerator.Generate`]: https://www.ookii.org/docs/answerfile-2.0/html/Overload_Ookii_AnswerFile_AnswerFileGenerator_Generate.htm
60-
[`AnswerFileGenerator`]: https://www.ookii.org/docs/answerfile-2.0/html/T_Ookii_AnswerFile_AnswerFileGenerator.htm
61-
[`AnswerFileOptions.DisplayResolution`]: https://www.ookii.org/docs/answerfile-2.0/html/P_Ookii_AnswerFile_AnswerFileOptions_DisplayResolution.htm
62-
[`AnswerFileOptions.InstallOptions`]: https://www.ookii.org/docs/answerfile-2.0/html/P_Ookii_AnswerFile_AnswerFileOptions_InstallOptions.htm
63-
[`AnswerFileOptions.JoinDomain`]: https://www.ookii.org/docs/answerfile-2.0/html/P_Ookii_AnswerFile_AnswerFileOptions_JoinDomain.htm
64-
[`AnswerFileOptions`]: https://www.ookii.org/docs/answerfile-2.0/html/T_Ookii_AnswerFile_AnswerFileOptions.htm
65-
[`CleanBiosOptions`]: https://www.ookii.org/docs/answerfile-2.0/html/T_Ookii_AnswerFile_CleanBiosOptions.htm
66-
[`CleanEfiOptions`]: https://www.ookii.org/docs/answerfile-2.0/html/T_Ookii_AnswerFile_CleanEfiOptions.htm
67-
[`DomainOptions`]: https://www.ookii.org/docs/answerfile-2.0/html/T_Ookii_AnswerFile_DomainOptions.htm
68-
[`DomainOptionsBase.DomainAccounts`]: https://www.ookii.org/docs/answerfile-2.0/html/P_Ookii_AnswerFile_DomainOptionsBase_DomainAccounts.htm
69-
[`DomainOptionsBase`]: https://www.ookii.org/docs/answerfile-2.0/html/T_Ookii_AnswerFile_DomainOptionsBase.htm
70-
[`ExistingPartitionOptions`]: https://www.ookii.org/docs/answerfile-2.0/html/T_Ookii_AnswerFile_ExistingPartitionOptions.htm
71-
[`FirstLogonScripts`]: https://www.ookii.org/docs/answerfile-2.0/html/P_Ookii_AnswerFile_AnswerFileOptions_FirstLogonScripts.htm
72-
[`ManualInstallOptions`]: https://www.ookii.org/docs/answerfile-2.0/html/T_Ookii_AnswerFile_ManualInstallOptions.htm
59+
[`AnswerFileGenerator.Generate`]: https://www.ookii.org/docs/answerfile-2.1/html/Overload_Ookii_AnswerFile_AnswerFileGenerator_Generate.htm
60+
[`AnswerFileGenerator`]: https://www.ookii.org/docs/answerfile-2.1/html/T_Ookii_AnswerFile_AnswerFileGenerator.htm
61+
[`AnswerFileOptions.DisplayResolution`]: https://www.ookii.org/docs/answerfile-2.1/html/P_Ookii_AnswerFile_AnswerFileOptions_DisplayResolution.htm
62+
[`AnswerFileOptions.InstallOptions`]: https://www.ookii.org/docs/answerfile-2.1/html/P_Ookii_AnswerFile_AnswerFileOptions_InstallOptions.htm
63+
[`AnswerFileOptions.JoinDomain`]: https://www.ookii.org/docs/answerfile-2.1/html/P_Ookii_AnswerFile_AnswerFileOptions_JoinDomain.htm
64+
[`AnswerFileOptions`]: https://www.ookii.org/docs/answerfile-2.1/html/T_Ookii_AnswerFile_AnswerFileOptions.htm
65+
[`CleanBiosOptions`]: https://www.ookii.org/docs/answerfile-2.1/html/T_Ookii_AnswerFile_CleanBiosOptions.htm
66+
[`CleanEfiOptions`]: https://www.ookii.org/docs/answerfile-2.1/html/T_Ookii_AnswerFile_CleanEfiOptions.htm
67+
[`DomainOptions`]: https://www.ookii.org/docs/answerfile-2.1/html/T_Ookii_AnswerFile_DomainOptions.htm
68+
[`DomainOptionsBase.DomainAccounts`]: https://www.ookii.org/docs/answerfile-2.1/html/P_Ookii_AnswerFile_DomainOptionsBase_DomainAccounts.htm
69+
[`DomainOptionsBase`]: https://www.ookii.org/docs/answerfile-2.1/html/T_Ookii_AnswerFile_DomainOptionsBase.htm
70+
[`ExistingPartitionOptions`]: https://www.ookii.org/docs/answerfile-2.1/html/T_Ookii_AnswerFile_ExistingPartitionOptions.htm
71+
[`FirstLogonScripts`]: https://www.ookii.org/docs/answerfile-2.1/html/P_Ookii_AnswerFile_AnswerFileOptions_FirstLogonScripts.htm
72+
[`ManualInstallOptions`]: https://www.ookii.org/docs/answerfile-2.1/html/T_Ookii_AnswerFile_ManualInstallOptions.htm

doc/Ookii.AnswerFile.shfbproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<IndentHtml>False</IndentHtml>
5555
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
5656
<SaveComponentCacheCapacity>100</SaveComponentCacheCapacity>
57-
<HelpTitle>Ookii.AnswerFile 2.0 Documentation</HelpTitle>
57+
<HelpTitle>Ookii.AnswerFile 2.1 Documentation</HelpTitle>
5858
<HelpFileVersion>1.0.0.0</HelpFileVersion>
5959
<NamingMethod>MemberName</NamingMethod>
6060
<ContentPlacement>AboveNamespaces</ContentPlacement>

doc/refs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"#apiPrefix": "https://learn.microsoft.com/dotnet/api/",
3-
"#prefix": "https://www.ookii.org/docs/answerfile-2.0/html/",
3+
"#prefix": "https://www.ookii.org/docs/answerfile-2.1/html/",
44
"#suffix": ".htm",
55
"AnswerFileGenerator": "T_Ookii_AnswerFile_AnswerFileGenerator",
66
"AnswerFileGenerator.Generate": "Overload_Ookii_AnswerFile_AnswerFileGenerator_Generate",

0 commit comments

Comments
 (0)