Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(GH-394) chocolatey.dll no more #479

Merged
merged 20 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
boxstarter choco extension
  • Loading branch information
mwallner authored and gep13 committed Apr 25, 2022
commit 99640e89152c64e0f8dc35443898b05b72b7f050
3 changes: 2 additions & 1 deletion Boxstarter.Bootstrapper/BoxStarter.Bootstrapper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Export-ModuleMember Invoke-BoxStarter, `
Stop-TimedSection, `
Out-Boxstarter, `
Enter-BoxstarterLogable, `
Get-BoxstarterTempDir
Get-BoxstarterTempDir, `
Setup-BoxstarterExtension
16 changes: 16 additions & 0 deletions Boxstarter.Bootstrapper/Cleanup-Boxstarter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ function Cleanup-Boxstarter {
}
Start-UpdateServices

$extensionBaseDir = "$env:ChocolateyInstall\extensions\boxstarter-choco"
if (Test-Path $extensionBaseDir) {
Remove-Item $extensionBaseDir -Recurse -Force -ErrorAction SilentlyContinue

Import-Module "$env:ChocolateyInstall/helpers/chocolateyProfile.psm1" -DisableNameChecking:$true
. "$env:ChocolateyInstall/helpers/functions/Write-FunctionCallLogMessage.ps1"
. "$env:ChocolateyInstall/helpers/functions/Test-ProcessAdminRights.ps1"
. "$env:ChocolateyInstall/helpers/functions/Set-EnvironmentVariable.ps1"
. "$env:ChocolateyInstall/helpers/functions/Uninstall-ChocolateyEnvironmentVariable.ps1"
$uninstallEnvVarParam = @{
variableName = 'BoxstarterChocoExtension'
variableType = [System.EnvironmentVariableTarget]::Machine
}
Uninstall-ChocolateyEnvironmentVariable @uninstallEnvVarParam
}

if(Test-Path "$(Get-BoxstarterTempDir)\BoxstarterReEnableUAC") {
del "$(Get-BoxstarterTempDir)\BoxstarterReEnableUAC"
Enable-UAC
Expand Down
25 changes: 25 additions & 0 deletions Boxstarter.Bootstrapper/Setup-BoxstarterExtension.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

function Setup-BoxstarterExtension {
$extensionBaseDir = "$env:ChocolateyInstall\extensions\boxstarter-choco"
New-Item -ItemType Directory -Path $extensionBaseDir -Force | Out-Null

@"
if (`$env:BoxstarterChocoExtension) {
Write-Host "Lets.GetBoxstarter() :-)"
Import-Module '$($boxstarter.BaseDir)\Boxstarter.Chocolatey\Boxstarter.Chocolatey.psd1' -DisableNameChecking -ArgumentList `$true
Write-Host "Boxstarter superpowers initiated..."
}
"@ | Out-File "$extensionBaseDir/boxstarter-choco.psm1" -Encoding utf8

Import-Module "$env:ChocolateyInstall/helpers/chocolateyProfile.psm1" -DisableNameChecking:$true
. "$env:ChocolateyInstall/helpers/functions/Write-FunctionCallLogMessage.ps1"
. "$env:ChocolateyInstall/helpers/functions/Test-ProcessAdminRights.ps1"
. "$env:ChocolateyInstall/helpers/functions/Set-EnvironmentVariable.ps1"
. "$env:ChocolateyInstall/helpers/functions/Install-ChocolateyEnvironmentVariable.ps1"
$installEnvVarParam = @{
variableName = 'BoxstarterChocoExtension'
variableValue = 'absolutely'
variableType = [System.EnvironmentVariableTarget]::Machine
}
Install-ChocolateyEnvironmentVariable @installEnvVarParam
}
Loading