Merge pull request #506 from Romanitho/install-counter

Add installation counter via an asset text file
pull/508/head
Romain 2023-12-05 15:49:13 +01:00 committed by GitHub
commit fb0c8a5776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 4 deletions

View File

@ -98,6 +98,8 @@ jobs:
cd Policies cd Policies
zip -r ../WAU_ADMX.zip * zip -r ../WAU_ADMX.zip *
cd .. cd ..
# Add install counter
echo "Install counter file." > WAU_InstallCounter
- name: Create release - name: Create release
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0 uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
@ -107,7 +109,7 @@ jobs:
prerelease: true prerelease: true
generateReleaseNotes: true generateReleaseNotes: true
name: "v${{ steps.versioning.outputs.version }} [Nightly Build]" name: "v${{ steps.versioning.outputs.version }} [Nightly Build]"
artifacts: "WAU.zip,WAU_ADMX.zip" artifacts: "WAU.zip,WAU_ADMX.zip,WAU_InstallCounter"
- name: URL to release - name: URL to release
run: echo "Release -> ${{ steps.release.outputs.html_url }}" run: echo "Release -> ${{ steps.release.outputs.html_url }}"

View File

@ -71,6 +71,8 @@ jobs:
cd Policies cd Policies
zip -r ../WAU_ADMX.zip * zip -r ../WAU_ADMX.zip *
cd .. cd ..
# Add install counter
echo "Install counter file." > WAU_InstallCounter
- name: Create release - name: Create release
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0 uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
@ -79,4 +81,4 @@ jobs:
prerelease: ${{ github.event.inputs.pre-release }} prerelease: ${{ github.event.inputs.pre-release }}
generateReleaseNotes: true generateReleaseNotes: true
name: "v${{ steps.versioning.outputs.version }}" name: "v${{ steps.versioning.outputs.version }}"
artifacts: "WAU.zip,WAU_ADMX.zip" artifacts: "WAU.zip,WAU_ADMX.zip,WAU_InstallCounter"

View File

@ -3,7 +3,8 @@
# Winget-AutoUpdate (WAU) # Winget-AutoUpdate (WAU)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/Romanitho/Winget-AutoUpdate?label=Latest%20Stable%20Release&style=flat-square)](https://github.com/Romanitho/Winget-AutoUpdate/releases/latest) [![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/Romanitho/Winget-AutoUpdate?label=Latest%20Stable%20Release&style=flat-square)](https://github.com/Romanitho/Winget-AutoUpdate/releases/latest)
[![GitHub release (by tag)](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/latest/total?label=Downloads&style=flat-square)](https://github.com/Romanitho/Winget-AutoUpdate/releases/latest) [![GitHub release (by tag)](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/latest/WAU.zip?label=Downloads&style=flat-square)](https://github.com/Romanitho/Winget-AutoUpdate/releases/latest)
<!-- [![GitHub release (by tag)](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/latest/WAU_InstallCounter?label=Installations&style=flat-square)](https://github.com/Romanitho/Winget-AutoUpdate/releases/latest) -->
</div> </div>
@ -229,7 +230,8 @@ Feel free to give us any suggestions or optimizations in code and support us by
#### WAU - GitHub #### WAU - GitHub
[![GitHub release (release name instead of tag name)](https://img.shields.io/github/v/release/Romanitho/Winget-AutoUpdate?display_name=release&include_prereleases&label=Latest%20Release&style=flat-square)](https://github.com/Romanitho/Winget-AutoUpdate/releases/) [![GitHub release (release name instead of tag name)](https://img.shields.io/github/v/release/Romanitho/Winget-AutoUpdate?display_name=release&include_prereleases&label=Latest%20Release&style=flat-square)](https://github.com/Romanitho/Winget-AutoUpdate/releases/)
[![GitHub release (latest by SemVer including pre-releases)](https://img.shields.io/github/downloads-pre/Romanitho/Winget-AutoUpdate/latest/total?label=Downloads&style=flat-square)](https://github.com/Romanitho/Winget-AutoUpdate/releases/)<br> [![GitHub release (latest by SemVer including pre-releases)](https://img.shields.io/github/downloads-pre/Romanitho/Winget-AutoUpdate/latest/WAU.zip?label=Downloads&style=flat-square)](https://github.com/Romanitho/Winget-AutoUpdate/releases/)
[![GitHub release (latest by SemVer including pre-releases)](https://img.shields.io/github/downloads-pre/Romanitho/Winget-AutoUpdate/latest/WAU_InstallCounter?label=Installations&style=flat-square)](https://github.com/Romanitho/Winget-AutoUpdate/releases/)<br>
[![GitHub all releases](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/total?label=Total%20downloads&style=flat-square)](https://somsubhra.github.io/github-release-stats/?username=Romanitho&repository=Winget-AutoUpdate&page=1&per_page=1000) [![GitHub all releases](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/total?label=Total%20downloads&style=flat-square)](https://somsubhra.github.io/github-release-stats/?username=Romanitho&repository=Winget-AutoUpdate&page=1&per_page=1000)
</div> </div>

View File

@ -338,6 +338,9 @@ function Install-WingetAutoUpdate {
Add-Shortcut "wscript.exe" "${env:Public}\Desktop\WAU - Check for updated Apps.lnk" "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\user-run.ps1`"`"" "${env:SystemRoot}\System32\shell32.dll,-16739" "Manual start of Winget-AutoUpdate (WAU)..." Add-Shortcut "wscript.exe" "${env:Public}\Desktop\WAU - Check for updated Apps.lnk" "`"$($WAUinstallPath)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUinstallPath)\user-run.ps1`"`"" "${env:SystemRoot}\System32\shell32.dll,-16739" "Manual start of Winget-AutoUpdate (WAU)..."
} }
#Add 1 to counter file
Invoke-RestMethod -Uri "https://github.com/Romanitho/Winget-AutoUpdate/releases/download/$($WAUVersion)/WAU_InstallCounter" | Out-Null
Write-ToLog "-> WAU Installation succeeded!`n" "Green" Write-ToLog "-> WAU Installation succeeded!`n" "Green"
Start-sleep 1 Start-sleep 1

View File

@ -182,6 +182,9 @@ function Invoke-PostUpdateActions {
#Get updated WAU Config #Get updated WAU Config
$Script:WAUConfig = Get-WAUConfig $Script:WAUConfig = Get-WAUConfig
#Add 1 to counter file
Invoke-RestMethod -Uri "https://github.com/Romanitho/Winget-AutoUpdate/releases/download/$($WAUVersion)/WAU_InstallCounter" | Out-Null
#log #log
Write-ToLog "Post Update actions finished" "green" Write-ToLog "Post Update actions finished" "green"