Loading...

Auto Update Docker Desktop for Windows even with no admin rights using a Windows Service

Reply A+ A-

In this post I will show you a way to auto update Docker Desktop for Windows on devices using a Windows service even if user do not have admin rights.

Context
- I have to deploy Docker Desktop for Windows on devices
- Users don't have admin rights
- When a new version od Docker is available, it allows you to update it
- Updating Docker Desktop requires admin rights

The script
Click on the below GitHub link to get the scripts:


The solution
In order to update Docker Desktop for user without to give them admin rights I created a Windows Service.
This service is executed in SYSTEM context on the user session.
The script will check for newer version and install it if true.

Special thanks to Manel and Jérôme for testing the solution.

What does the script ?
The script proceeds as below:
1. Get the installed version of Docker Deskop
2. Go to the Docker Desktop release page, here
3. Check latest version build
4. Compare the latest version available with this one installed
5. If latest version is greater, a GUI will be displayed

6. If you click on Run the update
7. Download the EXE
6. Install the newer version from EXE

Note: During the process, some toast notifications are displayed to inform of the download and install status

What does the service ?
The Windows Service proceeds as below:
1. Run the auto update script every 5 hours
2. You can change this easily

The log
Every actions from the service is logged.
You can find the log file in C:\Windows\Debug.
The log file is called Docker_update.log
See below an overview when no version has been found:
See below an overview when a new version has been found:

The update GUI
As mentioned previously, a GII is displayed to warn user a new versionis available and he should kill docker.
You can customize it as below:
1. Go to the folder Update_Warning
2. Open the file Warning_Config.xml
3. Change text as you want from the XML

How to create the service ?
Tun the script: Create_Docker_Auto_Update.ps1
This one allows you to:
1. Copy auto update content in ProgramData
2. Create the service.
3. Download the folder
4. Run this script in admin mode
5. The service will be created 

Update process in action
Before the update, I had the version 2.2.0.5 installed.
See below the update process:

slider 5255164950906169721

Enregistrer un commentaire

Accueil item

Award

Sponsors

Learn KQL in one month

You want to support me ?

Mes articles en français

Books in French


Stats