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

Added Conditional Download for OneDrive Setup #54

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

bmkaiser
Copy link

Problem

When using Save-OSDBuilderDownload, OneDriveSetup.exe is always downloaded even if the $GetOSDBuilderPathContentOneDrive directory already has the latest version downloaded (or newer if using the Insider release).

When using New-OSBuild, OneDriveSetup.exe is always copied to the image if it exists in the $GetOSDBuilderPathContentOneDrive directory even if it's an older version than what's already in the image.

Both of these problems introduce unnecessary time and bandwidth usage during the build or content preparation process, and they can lead to scenarios where OneDrive is actually downgraded to an older version.

Solution

To resolve these problems, I created a function in Save-OSDBuilderDownload that only downloads OneDriveSetup.exe if needed and added similar logic to New-OSBuild.

Save-OSDBuilderDownload Change Summary

Scenario 1

Scenario: OneDriveSetup.exe is already downloaded and is the most recent version or newer

Result: OneDriveSetup.exe will not be downloaded

Scenario 2

Scenario: OneDriveSetup.exe is not downloaded or cannot be found

Result: OneDriveSetup.exe will be downloaded

Scenario 3

Scenario: OneDriveSetup.exe is already downloaded, but is not the most recent version

Result: OneDriveSetup.exe will be downloaded

Output

Output for these scenarios will look like this:

PowerShell Prompt

New-OSBuild Change Summary

Scenario 1

Scenario: OneDriveSetup.exe in the content directory is not newer than what's in the image's System directory

Result: OneDriveSetup.exe will not be copied from the content directory to the image's system directory

Output

Output for this scenario will look like this:

PowerShell Prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant