• Welcome to Support Forum: Get Support for Patch My PC Products and Services.
 

Amazon Workspaces Auto Update Disable

Started by cmacnichol, May 07, 2020, 03:25:55 PM

Previous topic - Next topic

cmacnichol

I think this was brought up before, but it has been a while.  Has the Amazon Workspaces application been reviewed recently to see if it is possible to disable the Auto update notification?  I am still packaging this one normally as a user application due to this.  Installing as System just causes issues as users keep trying to update it when they cannot.

Andrew Jimenez (Patch My PC)

I just did some additional searching and it does not seem that Amazon has added this feature. I did notice multiple complaints about this same issue on their boards however.

cmacnichol

Yeah, I have been messing with this on and off for months.  It appears that the only way to disable updates is to do it for every user in the directory the workspace is attached too.  Further, the update controls of the Installer Amazon is using do not get honored when set in the registry.  I am unable to disable updates for the entire directory as I have some machines that are not managed.

If you ever figure out a way to block updates, let me\us know as it is sorely needed.

Andrew Jimenez (Patch My PC)

We'll definitely keep an eye out, and if you are able to determine how to block updates, please let us know and we will add it to the product. Thanks!

cmacnichol

Quote from: Andrew Jimenez on May 08, 2020, 10:54:12 AM
We'll definitely keep an eye out, and if you are able to determine how to block updates, please let us know and we will add it to the product. Thanks!

Hi Andrew,

We were finally able to get an answer out of Amazon on how to disable the updates for this product.  It is still being tested on our side, but so far it does appear to work.  I have included the information that Amazon provided as well as the (barebones) powershell script we are using to update the file.  Note, I have not updated the script yet to handle 32bit machines.

QuoteOption 1: Disable client updates via Windows registry (For clients up to 2.5.x)

1. Login to Windows WorkSpace Client workstation.
2. Open registry editor
3. Navigate to registry path: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Amazon\
4. Create a new key "Amazon WorkSpace Client", if doesn't exist already.
5. Create a new string type "clientUpgradeDisabled" and add Value:1

Path: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Amazon\Amazon WorkSpaces Client\clientUpgradeDisabled

Type: REG_SZ

Value: 1

This registry entry can be applied to other windows workstations using Group-policy or other third party windows application management tools.


Option 2: Make changes in the WorkSpace.dll.config file in the WorkSpace Client installation directory (for client v3.x.x)


1. Navigate to WorkSpace Client Installation directory: C:\Program Files (x86)\Amazon Web Services, Inc\Amazon WorkSpaces
2. Open WorkSpace.dll.config file
3. Rename the "UpdateUrl" tag or remove the update url and save the file (You will need Admin privileges).

Please note that this workaround is only at the individual user level and a re-installion of WorkSpace client will update the .config file back to default.

$configFile = "C:\Program Files (x86)\Amazon Web Services, Inc\Amazon WorkSpaces\workspaces.dll.config"

$xml = [xml]([System.IO.File]::ReadAllText($configFile))
$xml.PreserveWhitespace = $true

# Remove Update URL from Attribute
$key = $xml.SelectNodes("//configuration/appSettings/*") | Where-Object {$_.key -eq 'UpdateUrl'}
$key.Value = ""

#Settings object will instruct how the xml elements are written to the file
$settings = New-Object System.Xml.XmlWriterSettings
$settings.Indent = $true
#NewLineChars will affect all newlines
$settings.NewLineChars ="`r`n"
#Set an optional encoding, UTF-8 is the most used (without BOM)
$settings.Encoding = New-Object System.Text.UTF8Encoding( $false )

$file = [System.Xml.XmlWriter]::Create($configFile, $settings)
try{
    $xml.Save( $file )
} finally{
    $file.Dispose()
}


Let us know if this could be incorporated into your package.

Thanks,
Chris

Andrew Jimenez (Patch My PC)

So does Option 1 not work on newer clients? We may be able to incorportate Option 2 as a post-script, we'll discuss internally and see if we can add this directly to the product.

Thank you so much for providing this info!

cmacnichol

Quote from: Andrew Jimenez on November 02, 2020, 11:54:23 AM
So does Option 1 not work on newer clients? We may be able to incorporate Option 2 as a post-script, we'll discuss internally and see if we can add this directly to the product.

Thank you so much for providing this info!

I have not tested the registry option, mostly as they specifically called out that it did not work with later versions.  Here is the full script I am now using, take whatever you need from it.

#requires -version 3
<#
    .SYNOPSIS
    WorkspacesClient_Custom_PostInstall

    .DESCRIPTION
    PatchMyPC Customization Script for Amazon Workspaces Client

    .NOTES
    Version:        1.0
    Author:         Christopher Macnichol
    Creation Date: 11/02/2020
    Purpose/Change: Initial script development
    11/02/2020 - 1.0 - Chris Macnichol - Initial Script Development
   
#>

try
{
  $configFileX64 = "${env:ProgramFiles(x86)}\Amazon Web Services, Inc\Amazon WorkSpaces\workspaces.dll.config"
  $configFileX86 = "$env:ProgramW6432\Amazon Web Services, Inc\Amazon WorkSpaces\workspaces.dll.config"

  If (Test-Path -Path $configFileX64 -ErrorAction SilentlyContinue){ $configFile = $configFileX64}
  elseif (Test-Path -Path $configFileX86 -ErrorAction SilentlyContinue){ $configFile = $configFileX86}
  else {$configFile = $null}


  If ($configFile) {
    $xml = [xml]([System.IO.File]::ReadAllText($configFile))
    $xml.PreserveWhitespace = $true

    # Remove Update URL from Attribute
    $key = $xml.SelectNodes('//configuration/appSettings/*') | Where-Object {$_.key -eq 'UpdateUrl'}
    $key.Value = ''

    #Settings object will instruct how the xml elements are written to the file
    $settings = New-Object -TypeName System.Xml.XmlWriterSettings
    $settings.Indent = $true
    #NewLineChars will affect all newlines
    $settings.NewLineChars ="`r`n"
    #Set an optional encoding, UTF-8 is the most used (without BOM)
    $settings.Encoding = New-Object -TypeName System.Text.UTF8Encoding -ArgumentList ( $false )

    $file = [System.Xml.XmlWriter]::Create($configFile, $settings)
    try{
      $xml.Save( $file )
    } finally{
      $file.Dispose()
    }
  }
}
catch
{
  ('Error was {0}' -f $_)
  $line = $_.InvocationInfo.ScriptLineNumber
  ('Error was in Line {0}' -f $line)
  Exit 1602
}

Exit 0