Skip to content

Commit 7aeb193

Browse files
committed
Added new wrapper to replace vbscript wrapper
Updated wrapper to replace the vbscript wrapper in the next releases.
1 parent 1680b88 commit 7aeb193

11 files changed

Lines changed: 92 additions & 6 deletions

Refresh-WingetConfiguration.ps1

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,23 @@ $PolicyListLocation = $PolicyRegistryLocation + "\List"
1414
$PolicyModLocation = $PolicyRegistryLocation + "\Mods"
1515
$DataDir = "$env:Programdata\Winget-AutoUpdate-Configurator";
1616
$scriptlocation = $MyInvocation.MyCommand.Path + "\.."
17-
$wauWrapperEXE = "$scriptlocation\WinGet-AutoUpdate-Configurator\Winget-AutoUpdate.exe"
1817

1918
Import-Module "$scriptLocation\WinGet-AutoUpdate-Configurator\Generic.psm1"
2019

2120
<# FUNCTIONS #>
2221

22+
function Get-WAUWrapperEXE {
23+
$arch = (Get-WMIObject -Class Win32_Processor).Architecture;
24+
25+
$wauWrapperEXE = "$scriptlocation\WinGet-AutoUpdate-Configurator\Winget-AutoUpdate-x86.exe"
26+
if ( $arch -eq 9 ) {
27+
$wauWrapperEXE = "$scriptlocation\WinGet-AutoUpdate-Configurator\Winget-AutoUpdate-x64.exe"
28+
} elseif ( $arch -eq 12 ) {
29+
$wauWrapperEXE = "$scriptlocation\WinGet-AutoUpdate-Configurator\Winget-AutoUpdate-arm64.exe"
30+
}
31+
return $wauWrapperEXE;
32+
}
33+
2334
function Write-ListConfigToFile {
2435
param(
2536
$FilePath,
@@ -273,7 +284,10 @@ if ( $commandLineArguments -ne $previousCommandLineArguments ) {
273284
iex $installCommand;
274285
Write-LogFile "Updated WAU." -Severity 1
275286

276-
if ( 0 ) { # This code is not ready yet.
287+
if ( 1 ) { # This code is not ready yet.
288+
$wauWrapperEXE = Get-WAUWrapperEXE;
289+
Write-LogFile -InputObject "Retrived wrapper exe $wauWrapperEXE." -Severity 1
290+
277291
# Overwrite original Winget Tasks with WAUC Tasks. This is allows configuring WAUC as a managed installer.
278292
$RunWingetAutoupdateAction = New-ScheduledTaskAction -Execute $wauWrapperEXE -Argument "[ARGSSELECTOR|winget-upgrade]"
279293

62.5 KB
Binary file not shown.

WinGet-AutoUpdate-Configurator/Winget-AutoUpdate.exe.config renamed to WinGet-AutoUpdate-Configurator/Winget-AutoUpdate-arm64.exe.config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1"/>
55
</startup>
66
<System.Windows.Forms.ApplicationConfigurationSection>
7-
<add key="DpiAwareness" value="PerMonitorV2" />
7+
<add key="DpiAwareness" value="PerMonitorV2"/>
88
</System.Windows.Forms.ApplicationConfigurationSection>
9-
</configuration>
9+
</configuration>

WinGet-AutoUpdate-Configurator/Winget-AutoUpdate.exe.wrunconfig renamed to WinGet-AutoUpdate-Configurator/Winget-AutoUpdate-arm64.exe.wrunconfig

File renamed without changes.
62.5 KB
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
5+
</startup>
6+
<System.Windows.Forms.ApplicationConfigurationSection>
7+
<add key="DpiAwareness" value="PerMonitorV2"/>
8+
</System.Windows.Forms.ApplicationConfigurationSection>
9+
</configuration>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<config>
3+
<Process>
4+
<ArgsSelector>winget-upgrade</ArgsSelector>
5+
<Filename>powershell.exe</Filename>
6+
<WorkingDirectory>[APPDIR]</WorkingDirectory>
7+
<Arguments>-NoProfile -ExecutionPolicy AllSigned -File "[RETRIVEFROMREGISTRY|HKLM|SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate|InstallLocation|C:\ProgramData\Winget-AutoUpdate]\winget-upgrade.ps1"</Arguments>
8+
<SetExitCode>1</SetExitCode>
9+
<WindowStyle>Hidden</WindowStyle>
10+
</Process>
11+
<Process>
12+
<ArgsSelector>user-run</ArgsSelector>
13+
<Filename>powershell.exe</Filename>
14+
<WorkingDirectory>[APPDIR]</WorkingDirectory>
15+
<Arguments>-NoProfile -ExecutionPolicy AllSigned -File "[RETRIVEFROMREGISTRY|HKLM|SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate|InstallLocation|C:\ProgramData\Winget-AutoUpdate]\user-run.ps1" [RESOLVED_ARGS]</Arguments>
16+
<SetExitCode>1</SetExitCode>
17+
<WindowStyle>Hidden</WindowStyle>
18+
</Process>
19+
<Process>
20+
<ArgsSelector>notify-user</ArgsSelector>
21+
<Filename>powershell.exe</Filename>
22+
<WorkingDirectory>[APPDIR]</WorkingDirectory>
23+
<Arguments>-NoProfile -ExecutionPolicy AllSigned -File "[RETRIVEFROMREGISTRY|HKLM|SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate|InstallLocation|C:\ProgramData\Winget-AutoUpdate]\winget-notify.ps1"</Arguments>
24+
<SetExitCode>1</SetExitCode>
25+
<WindowStyle>Hidden</WindowStyle>
26+
</Process>
27+
</config>
63 KB
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
5+
</startup>
6+
<System.Windows.Forms.ApplicationConfigurationSection>
7+
<add key="DpiAwareness" value="PerMonitorV2"/>
8+
</System.Windows.Forms.ApplicationConfigurationSection>
9+
</configuration>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<config>
3+
<Process>
4+
<ArgsSelector>winget-upgrade</ArgsSelector>
5+
<Filename>powershell.exe</Filename>
6+
<WorkingDirectory>[APPDIR]</WorkingDirectory>
7+
<Arguments>-NoProfile -ExecutionPolicy AllSigned -File "[RETRIVEFROMREGISTRY|HKLM|SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate|InstallLocation|C:\ProgramData\Winget-AutoUpdate]\winget-upgrade.ps1"</Arguments>
8+
<SetExitCode>1</SetExitCode>
9+
<WindowStyle>Hidden</WindowStyle>
10+
</Process>
11+
<Process>
12+
<ArgsSelector>user-run</ArgsSelector>
13+
<Filename>powershell.exe</Filename>
14+
<WorkingDirectory>[APPDIR]</WorkingDirectory>
15+
<Arguments>-NoProfile -ExecutionPolicy AllSigned -File "[RETRIVEFROMREGISTRY|HKLM|SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate|InstallLocation|C:\ProgramData\Winget-AutoUpdate]\user-run.ps1" [RESOLVED_ARGS]</Arguments>
16+
<SetExitCode>1</SetExitCode>
17+
<WindowStyle>Hidden</WindowStyle>
18+
</Process>
19+
<Process>
20+
<ArgsSelector>notify-user</ArgsSelector>
21+
<Filename>powershell.exe</Filename>
22+
<WorkingDirectory>[APPDIR]</WorkingDirectory>
23+
<Arguments>-NoProfile -ExecutionPolicy AllSigned -File "[RETRIVEFROMREGISTRY|HKLM|SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate|InstallLocation|C:\ProgramData\Winget-AutoUpdate]\winget-notify.ps1"</Arguments>
24+
<SetExitCode>1</SetExitCode>
25+
<WindowStyle>Hidden</WindowStyle>
26+
</Process>
27+
</config>

0 commit comments

Comments
 (0)