Skip to content

Commit 01c3847

Browse files
authored
updating all recipes to use dynamic helper script loading (#69)
1 parent 1838966 commit 01c3847

6 files changed

Lines changed: 55 additions & 37 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ A recipe is the script you run. It calls multiple helper scripts. These curren
1717

1818
**Helper Scripts**: A helper script performs setup routines that may be useful by many recipes. Recipes call helper scripts (you don't run helper scripts directly). The helper scripts live in the **scripts** folder
1919

20-
2120
## You may want to customize the scripts
2221
These scripts should cover a lot of what you need but will not likely match your personal preferences exactly. In this case please fork the project and change the scripts however you desire. We really appreciate PR's back to this project if you have recommended changes.
2322

@@ -45,10 +44,13 @@ To run a recipe script, click a link in the table below from your target machine
4544
| | More Coming Soon! |
4645

4746
**Notes:**
48-
¹ If you're a Node.js contributor working on Node.js core, please see the [Node.js Bootstrapping Guide](https://github.com/nodejs/node/tree/master/tools/bootstrap) or [click here to run](http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter).
47+
1. If you are using WSL there's a followup step we recommend after running the setup script. When the script finishes you will only have a root user with a blank password. You should manually create a non-root user via `$ sudo adduser [USERNAME] sudo`
48+
with a non-blank password. Use this user going forward. For more info on WSL please refer to the [documentation](https://docs.microsoft.com/en-us/windows/wsl/about).
49+
2. If you're a Node.js contributor working on Node.js core, please see the [Node.js Bootstrapping Guide](https://github.com/nodejs/node/tree/master/tools/bootstrap) or [click here to run](http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter).
4950

5051
## Known issues
51-
- Windows 1803 is not successfully launching Boxstarter via the web launcher. This is actively under investigation and there are workarounds such as running Boxstarter locally. See this issue for details: https://github.com/chocolatey/boxstarter/issues/301
52+
- Reboot is not always logging you back in to resume the script. This is being tracked [here](https://github.com/chocolatey/boxstarter/issues/318). If you experience this please login manually and the script will continue running.
53+
- There have been reports of Windows 1803 not successfully launching Boxstarter via the web launcher. See this issue for details: https://github.com/chocolatey/boxstarter/issues/301
5254

5355
## Working with Chocolatey in an organization?
5456
As an organization, you may not be keen to reach out to the internet. That's fine as with just a few modifications you can still take advantage of these scripts. Visit the [organizational use page](ORGANIZATION.md) to learn how.

dev_app.ps1

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,21 @@
44

55
Disable-UAC
66

7-
# see if we can't get calling URL somehow, that would eliminate this need
8-
# should move to a config file
9-
$user = "Microsoft";
10-
$baseBranch = "master";
11-
$finalBaseHelperUri = "https://raw.githubusercontent.com/$user/windows-dev-box-setup-scripts/$baseBranch/scripts";
7+
# Get the base URI path from the ScriptToCall value
8+
$bstrappackage = "-bootstrapPackage"
9+
$helperUri = $Boxstarter['ScriptToCall']
10+
$strpos = $helperUri.IndexOf($bstrappackage)
11+
$helperUri = $helperUri.Substring($strpos + $bstrappackage.Length)
12+
$helperUri = $helperUri.TrimStart("'", " ")
13+
$helperUri = $helperUri.TrimEnd("'", " ")
14+
$helperUri = $helperUri.Substring(0, $helperUri.LastIndexOf("/"))
15+
$helperUri += "/scripts"
16+
write-host "helper script base URI is $helperUri"
1217

1318
function executeScript {
14-
Param ([string]$script)
15-
write-host "executing $finalBaseHelperUri/$script ..."
16-
iex ((new-object net.webclient).DownloadString("$finalBaseHelperUri/$script"))
19+
Param ([string]$script)
20+
write-host "executing $helperUri/$script ..."
21+
iex ((new-object net.webclient).DownloadString("$helperUri/$script"))
1722
}
1823

1924
#--- Setting up Windows ---

dev_ml_windows.ps1

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,21 @@
44

55
Disable-UAC
66

7-
# see if we can't get calling URL somehow, that would eliminate this need
8-
# should move to a config file
9-
$user = "Microsoft";
10-
$baseBranch = "MLSamples";
11-
$finalBaseHelperUri = "https://raw.githubusercontent.com/$user/windows-dev-box-setup-scripts/$baseBranch/scripts";
7+
# Get the base URI path from the ScriptToCall value
8+
$bstrappackage = "-bootstrapPackage"
9+
$helperUri = $Boxstarter['ScriptToCall']
10+
$strpos = $helperUri.IndexOf($bstrappackage)
11+
$helperUri = $helperUri.Substring($strpos + $bstrappackage.Length)
12+
$helperUri = $helperUri.TrimStart("'", " ")
13+
$helperUri = $helperUri.TrimEnd("'", " ")
14+
$helperUri = $helperUri.Substring(0, $helperUri.LastIndexOf("/"))
15+
$helperUri += "/scripts"
16+
write-host "helper script base URI is $helperUri"
1217

1318
function executeScript {
1419
Param ([string]$script)
15-
write-host "executing $finalBaseHelperUri/$script ..."
16-
iex ((new-object net.webclient).DownloadString("$finalBaseHelperUri/$script"))
20+
write-host "executing $helperUri/$script ..."
21+
iex ((new-object net.webclient).DownloadString("$helperUri/$script"))
1722
}
1823

1924
#--- Setting up Windows ---

dev_ml_wsl.ps1

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ Disable-UAC
66

77
# Get the base URI path from the ScriptToCall value
88
$bstrappackage = "-bootstrapPackage"
9-
$Boxstarter | Foreach-Object { write-host "The key name is $_.Key and value is $_.Value" }
10-
119
$helperUri = $Boxstarter['ScriptToCall']
12-
write-host "ScriptToCall is $helperUri"
13-
1410
$strpos = $helperUri.IndexOf($bstrappackage)
1511
$helperUri = $helperUri.Substring($strpos + $bstrappackage.Length)
1612
$helperUri = $helperUri.TrimStart("'", " ")

dev_web.ps1

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,23 @@
44

55
Disable-UAC
66

7+
# Get the base URI path from the ScriptToCall value
8+
$bstrappackage = "-bootstrapPackage"
9+
$helperUri = $Boxstarter['ScriptToCall']
10+
$strpos = $helperUri.IndexOf($bstrappackage)
11+
$helperUri = $helperUri.Substring($strpos + $bstrappackage.Length)
12+
$helperUri = $helperUri.TrimStart("'", " ")
13+
$helperUri = $helperUri.TrimEnd("'", " ")
14+
$helperUri = $helperUri.Substring(0, $helperUri.LastIndexOf("/"))
15+
$helperUri += "/scripts"
16+
write-host "helper script base URI is $helperUri"
17+
718
function executeScript {
819
Param ([string]$script)
9-
write-host "executing $finalBaseHelperUri/$script ..."
10-
iex ((new-object net.webclient).DownloadString("$finalBaseHelperUri/$script"))
20+
write-host "executing $helperUri/$script ..."
21+
iex ((new-object net.webclient).DownloadString("$helperUri/$script"))
1122
}
1223

13-
# see if we can't get calling URL somehow, that would eliminate this need
14-
# should move to a config file
15-
$user = "Microsoft";
16-
$baseBranch = "master";
17-
$finalBaseHelperUri = "https://raw.githubusercontent.com/$user/windows-dev-box-setup-scripts/$baseBranch/scripts";
18-
1924
#--- Setting up Windows ---
2025
executeScript "FileExplorerSettings.ps1";
2126
executeScript "SystemConfiguration.ps1";

dev_web_nodejs.ps1

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,21 @@
44

55
Disable-UAC
66

7-
# see if we can't get calling URL somehow, that would eliminate this need
8-
# should move to a config file
9-
$user = "Microsoft";
10-
$baseBranch = "master";
11-
$finalBaseHelperUri = "https://raw.githubusercontent.com/$user/windows-dev-box-setup-scripts/$baseBranch/scripts";
7+
# Get the base URI path from the ScriptToCall value
8+
$bstrappackage = "-bootstrapPackage"
9+
$helperUri = $Boxstarter['ScriptToCall']
10+
$strpos = $helperUri.IndexOf($bstrappackage)
11+
$helperUri = $helperUri.Substring($strpos + $bstrappackage.Length)
12+
$helperUri = $helperUri.TrimStart("'", " ")
13+
$helperUri = $helperUri.TrimEnd("'", " ")
14+
$helperUri = $helperUri.Substring(0, $helperUri.LastIndexOf("/"))
15+
$helperUri += "/scripts"
16+
write-host "helper script base URI is $helperUri"
1217

1318
function executeScript {
1419
Param ([string]$script)
15-
write-host "executing $finalBaseHelperUri/$script ..."
16-
iex ((new-object net.webclient).DownloadString("$finalBaseHelperUri/$script"))
20+
write-host "executing $helperUri/$script ..."
21+
iex ((new-object net.webclient).DownloadString("$helperUri/$script"))
1722
}
1823

1924
#--- Setting up Windows ---

0 commit comments

Comments
 (0)