Add FMA: Google Drive (#35915)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves # --------- Co-authored-by: Allen Houchins <32207388+allenhouchins@users.noreply.github.com>
This commit is contained in:
co-authored by
Allen Houchins
parent
1c3e52074e
commit
0fcc76bad5
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "Google Drive",
|
||||
"slug": "google-drive/darwin",
|
||||
"unique_identifier": "com.google.drivefs",
|
||||
"token": "google-drive",
|
||||
"installer_format": "dmg",
|
||||
"default_categories": ["Productivity"]
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "Google Drive",
|
||||
"slug": "google-drive/windows",
|
||||
"package_identifier": "Google.GoogleDrive",
|
||||
"unique_identifier": "Google Drive",
|
||||
"install_script_path": "ee/maintained-apps/inputs/winget/scripts/google_drive_install.ps1",
|
||||
"uninstall_script_path": "ee/maintained-apps/inputs/winget/scripts/google_drive_uninstall.ps1",
|
||||
"installer_arch": "x64",
|
||||
"installer_type": "exe",
|
||||
"installer_scope": "machine",
|
||||
"default_categories": ["Productivity"]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
$exeFilePath = "${env:INSTALLER_PATH}"
|
||||
|
||||
try {
|
||||
|
||||
$processOptions = @{
|
||||
FilePath = "$exeFilePath"
|
||||
ArgumentList = "--silent --skip_launch_new --gsuite_shortcuts=false"
|
||||
PassThru = $true
|
||||
Wait = $true
|
||||
}
|
||||
|
||||
# Start process and track exit code
|
||||
$process = Start-Process @processOptions
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
# Prints the exit code
|
||||
Write-Host "Install exit code: $exitCode"
|
||||
Exit $exitCode
|
||||
|
||||
} catch {
|
||||
Write-Host "Error: $_"
|
||||
Exit 1
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
$softwareName = "Google Drive"
|
||||
|
||||
$uninstallArgs = "--silent --force_stop"
|
||||
|
||||
$expectedExitCodes = @()
|
||||
|
||||
$machineKey = `
|
||||
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'
|
||||
$machineKey32on64 = `
|
||||
'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
|
||||
|
||||
$exitCode = 0
|
||||
|
||||
try {
|
||||
|
||||
[array]$uninstallKeys = Get-ChildItem `
|
||||
-Path @($machineKey, $machineKey32on64) `
|
||||
-ErrorAction SilentlyContinue |
|
||||
ForEach-Object { Get-ItemProperty $_.PSPath }
|
||||
|
||||
$foundUninstaller = $false
|
||||
foreach ($key in $uninstallKeys) {
|
||||
if ($key.DisplayName -eq $softwareName) {
|
||||
$foundUninstaller = $true
|
||||
# Get the uninstall command.
|
||||
$uninstallCommand = if ($key.QuietUninstallString) {
|
||||
$key.QuietUninstallString
|
||||
} else {
|
||||
$key.UninstallString
|
||||
}
|
||||
|
||||
# Split the command and args
|
||||
$splitArgs = $uninstallCommand.Split('"')
|
||||
if ($splitArgs.Length -gt 1) {
|
||||
if ($splitArgs.Length -eq 3) {
|
||||
$uninstallArgs = "$( $splitArgs[2] ) $uninstallArgs".Trim()
|
||||
} elseif ($splitArgs.Length -gt 3) {
|
||||
Throw `
|
||||
"Uninstall command contains multiple quoted strings. " +
|
||||
"Please update the uninstall script.`n" +
|
||||
"Uninstall command: $uninstallCommand"
|
||||
}
|
||||
$uninstallCommand = $splitArgs[1]
|
||||
}
|
||||
Write-Host "Uninstall command: $uninstallCommand"
|
||||
Write-Host "Uninstall args: $uninstallArgs"
|
||||
|
||||
$processOptions = @{
|
||||
FilePath = $uninstallCommand
|
||||
PassThru = $true
|
||||
Wait = $true
|
||||
ArgumentList = "$uninstallArgs".Split(' ')
|
||||
NoNewWindow = $true
|
||||
}
|
||||
|
||||
# Start process and track exit code
|
||||
$process = Start-Process @processOptions
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
Write-Host "Uninstall exit code: $exitCode"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $foundUninstaller) {
|
||||
Write-Host "Uninstaller for '$softwareName' not found."
|
||||
Exit 1
|
||||
}
|
||||
|
||||
} catch {
|
||||
Write-Host "Error: $_"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
if ($expectedExitCodes -contains $exitCode) {
|
||||
$exitCode = 0
|
||||
}
|
||||
|
||||
Exit $exitCode
|
||||
@@ -232,6 +232,20 @@
|
||||
"unique_identifier": "Google Chrome",
|
||||
"description": "Google Chrome Enterprise is a fast, reliable web browser built for performance and compatibility across platforms."
|
||||
},
|
||||
{
|
||||
"name": "Google Drive",
|
||||
"slug": "google-drive/darwin",
|
||||
"platform": "darwin",
|
||||
"unique_identifier": "com.google.drivefs",
|
||||
"description": "Google Drive is a cloud storage service that allows you to store, sync, and share files across devices with seamless access to your Google Workspace content."
|
||||
},
|
||||
{
|
||||
"name": "Google Drive",
|
||||
"slug": "google-drive/windows",
|
||||
"platform": "windows",
|
||||
"unique_identifier": "Google Drive",
|
||||
"description": "Google Drive is a cloud storage service that allows you to store, sync, and share files across devices with seamless access to your Google Workspace content."
|
||||
},
|
||||
{
|
||||
"name": "iMazing Profile Editor",
|
||||
"slug": "imazing-profile-editor/darwin",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"version": "116.0.6.0",
|
||||
"queries": {
|
||||
"exists": "SELECT 1 FROM programs WHERE name = 'Google Drive' AND publisher = 'Google LLC';"
|
||||
},
|
||||
"installer_url": "https://dl.google.com/release2/drive-file-stream/dsiupwjcww5gzroykb7fpxic4q_116.0.6.0/setup.exe",
|
||||
"install_script_ref": "fa36b892",
|
||||
"uninstall_script_ref": "785a96b9",
|
||||
"sha256": "5741e2d046554906b923257b8922d7109e5ac879c9fb6c376c988a5126ae90ae",
|
||||
"default_categories": [
|
||||
"Productivity"
|
||||
]
|
||||
}
|
||||
],
|
||||
"refs": {
|
||||
"785a96b9": "$softwareName = \"Google Drive\"\n\n$uninstallArgs = \"--silent --force_stop\"\n\n$expectedExitCodes = @()\n\n$machineKey = `\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n$machineKey32on64 = `\n 'HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n\n$exitCode = 0\n\ntry {\n\n [array]$uninstallKeys = Get-ChildItem `\n -Path @($machineKey, $machineKey32on64) `\n -ErrorAction SilentlyContinue |\n ForEach-Object { Get-ItemProperty $_.PSPath }\n\n $foundUninstaller = $false\n foreach ($key in $uninstallKeys) {\n if ($key.DisplayName -eq $softwareName) {\n $foundUninstaller = $true\n # Get the uninstall command.\n $uninstallCommand = if ($key.QuietUninstallString) {\n $key.QuietUninstallString\n } else {\n $key.UninstallString\n }\n\n # Split the command and args\n $splitArgs = $uninstallCommand.Split('\"')\n if ($splitArgs.Length -gt 1) {\n if ($splitArgs.Length -eq 3) {\n $uninstallArgs = \"$( $splitArgs[2] ) $uninstallArgs\".Trim()\n } elseif ($splitArgs.Length -gt 3) {\n Throw `\n \"Uninstall command contains multiple quoted strings. \" +\n \"Please update the uninstall script.`n\" +\n \"Uninstall command: $uninstallCommand\"\n }\n $uninstallCommand = $splitArgs[1]\n }\n Write-Host \"Uninstall command: $uninstallCommand\"\n Write-Host \"Uninstall args: $uninstallArgs\"\n\n $processOptions = @{\n FilePath = $uninstallCommand\n PassThru = $true\n Wait = $true\n ArgumentList = \"$uninstallArgs\".Split(' ')\n NoNewWindow = $true\n }\n\n # Start process and track exit code\n $process = Start-Process @processOptions\n $exitCode = $process.ExitCode\n\n Write-Host \"Uninstall exit code: $exitCode\"\n break\n }\n }\n\n if (-not $foundUninstaller) {\n Write-Host \"Uninstaller for '$softwareName' not found.\"\n Exit 1\n }\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n\nif ($expectedExitCodes -contains $exitCode) {\n $exitCode = 0\n}\n\nExit $exitCode\n",
|
||||
"fa36b892": "$exeFilePath = \"${env:INSTALLER_PATH}\"\n\ntry {\n\n$processOptions = @{\n FilePath = \"$exeFilePath\"\n ArgumentList = \"--silent --skip_launch_new --gsuite_shortcuts=false\"\n PassThru = $true\n Wait = $true\n}\n\n# Start process and track exit code\n$process = Start-Process @processOptions\n$exitCode = $process.ExitCode\n\n# Prints the exit code\nWrite-Host \"Install exit code: $exitCode\"\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
Reference in New Issue
Block a user