diff --git a/groups/win/base b/groups/win/base index 20f0b6a..61fec90 100644 --- a/groups/win/base +++ b/groups/win/base @@ -6,5 +6,5 @@ screentogif notepadplusplus pinta gimp -bulkrenameutility.install +bulkrenameutility utc diff --git a/groups/win/work b/groups/win/work new file mode 100644 index 0000000..d555a94 --- /dev/null +++ b/groups/win/work @@ -0,0 +1,6 @@ +win/tweaker +win/office +dev/tools +forensics +etcher +passwords diff --git a/handlers.available.windows b/handlers.available.windows index 1c2327b..c35373e 100644 --- a/handlers.available.windows +++ b/handlers.available.windows @@ -1,2 +1,2 @@ -powershell.ps1 -registry.reg +chocolatey +powershell.ps1 \ No newline at end of file diff --git a/handlers/chocolatey/install b/handlers/chocolatey/install index e8690c6..7990a5b 100755 --- a/handlers/chocolatey/install +++ b/handlers/chocolatey/install @@ -1,2 +1,6 @@ #!/bin/sh -powershell -Command "Start-Process 'choco' -Verb runAs -ArgumentList 'install $*'" \ No newline at end of file +# https://stackoverflow.com/questions/43650595/is-there-a-command-to-check-if-git-bash-is-opened-in-administrator-mode/58846650#58846650 +if [[ $(sfc 2>&1 | tr -d '\0') =~ SCANNOW ]] +then choco install "$@" +else exec powershell -Command "Start-Process 'choco' -Verb runAs -ArgumentList 'install $*'" +fi \ No newline at end of file diff --git a/i.ps1 b/i.ps1 new file mode 100644 index 0000000..ff0018e --- /dev/null +++ b/i.ps1 @@ -0,0 +1,6 @@ +# manual execution: Set-ExecutionPolicy Bypass -Scope Process -Force; .\i +(Test-Path "$PWD\instalee") -and (cd instalee) +packages\chocolatey\powershell.ps1 +Start-Process -Wait choco -Verb runAs -ArgumentList 'install git' +Start-Process -Wait "C:\Program Files\Git\git-bash.exe" -Verb runAs -ArgumentList "-c './instalee win/office; sleep 10 || bash'" +Sleep 10 \ No newline at end of file diff --git a/packages/chocolatey/powershell.ps1 b/packages/chocolatey/powershell.ps1 index 6fc1a68..9a923c4 100755 --- a/packages/chocolatey/powershell.ps1 +++ b/packages/chocolatey/powershell.ps1 @@ -6,19 +6,18 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]: [Security.Principal.WindowsBuiltInRole] 'Administrator') ) { - Write-Host "Not elevated, restarting..." + Write-Host "Not elevated, relaunching $($MyInvocation.MyCommand.Path)..." $Loc = Get-Location $Arguments = @( '-NoProfile', '-ExecutionPolicy Bypass', - '-NoExit', '-File', "`"$($MyInvocation.MyCommand.Path)`"", "\`"$Loc\`"" ) - Start-Process -FilePath PowerShell.exe -Verb RunAs -ArgumentList $Arguments - Break + Start-Process -Wait -FilePath PowerShell.exe -Verb RunAs -ArgumentList $Arguments + Return } if($Loc.Length -gt 1){ Set-Location $Loc.Substring(1,$Loc.Length-2) diff --git a/packages/files/chocolatey b/packages/files/chocolatey new file mode 100644 index 0000000..e69de29 diff --git a/packages/utc/powershell.ps1 b/packages/utc/powershell.ps1 new file mode 100644 index 0000000..4fe6c38 --- /dev/null +++ b/packages/utc/powershell.ps1 @@ -0,0 +1,2 @@ + +powershell -Command "Start-Process 'reg' -Verb runAs -ArgumentList 'add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /d 1 /f'"