Note: the software was listed in ITNinja's database as Salesforce Apex Dataloader. My install identified itself as only Salesforce Dataloader 49.0.0 and presumably that is the same thing.
To install:
Salesforce provided an install.bat but it is designed to install for only the installing user. I modified their install.bat into install.ps1 to do the same thing but for all users:
# Get all user profiles, removing unnecessary profiles (DefaultAppPool, Public, Administrator, etc.)
$windowsprofiles = Get-ChildItem C:\Users | select -ExpandProperty Name
$userprofiles = $windowsprofiles | Where-Object {($_ -ne 'DefaultAppPool') -and ($_ -ne 'Public') -and ($_ -ne 'defaultuser0') -and ($_ -notlike ".NET*") -and ($_ -ne "ADMINI~1")}
# Delete existing Data Loader
# Converted from the vendor; probably to remove older versions if they exist
foreach ($userprofile in $userprofiles)
{
$DataloaderPath = "C:\Users\$userprofile\dataloader\v49.0.0"
Write-host "Deleting v49 folder from profile: $userprofile" -ForegroundColor Yellow
Remove-Item $DataloaderPath -Recurse -ErrorAction SilentlyContinue
}
# Copy files to each user profile
foreach ($userprofile in $userprofiles)
{
Write-host "Copying datafolder to \$userprofile\dataloader\v49.0.0" -ForegroundColor Yellow
Copy-Item -Path .\32\dataloader_win -Destination "C:\Users\$userprofile\dataloader\v49.0.0" -Recurse -Force -ErrorAction SilentlyContinue
}
# Create Desktop shortcut per user
# Vendor install creates a shortcut on the desktop of each user; $installdir is user-specific so it cannot be created in \Public
# Since we redirect to a network location, this is not possible. Preserved for explanation.
<#foreach ($userprofile in $userprofiles)
{
# Set Installation Dir variable
$installdir = "C:\Users\$userprofile\dataloader\v49.0.0"
$WshShell = New-Object -comObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut("C:\Users\$userprofile\Desktop\Dataloader.lnk"); $Shortcut.WorkingDirectory = $installdir; $Shortcut.TargetPath = "$installdir\dataloader.bat"; $Shortcut.IconLocation = "$installdir\dataloader.ico"; $Shortcut.Save()
}
#>
# Create Start Menu item
foreach ($userprofile in $userprofiles)
{
# Set Installation Dir variable
$installdir = "C:\Users\$userprofile\dataloader\v49.0.0"
# Create Start Menu item
if (-not (Test-Path "C:\Users\$userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Salesforce\")) {New-Item -Path "C:\Users\$userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs" -Name Salesforce -ItemType directory}
$WshShell = New-Object -comObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut("C:\Users\$userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Salesforce\Dataloader.lnk"); $Shortcut.WorkingDirectory = $installdir; $Shortcut.TargetPath = "$installdir\dataloader.bat"; $Shortcut.IconLocation = "$installdir\dataloader.ico"; $Shortcut.Save()
}
To uninstall:
# Get all user profiles, remove unnecessary profiles
$windowsprofiles = Get-ChildItem C:\Users | select -ExpandProperty Name
$userprofiles = $windowsprofiles | Where-Object {($_ -ne 'DefaultAppPool') -and ($_ -ne 'Public') -and ($_ -ne 'defaultuser0') -and ($_ -notlike ".NET*") -and ($_ -ne "ADMINI~1")}
# Delete dataloader folder
# Copied from the vendor; probably to remove older versions if they exist
Foreach ($userprofile in $userprofiles)
{
$DataloaderPath = "C:\Users\$userprofile\dataloader"
Remove-Item $DataloaderPath -Recurse -Force
}
# Delete shortcut from Public desktop (commented out, unnecessary due to Desktop redirection)
# Remove-Item "$env:PUBLIC\Desktop\Dataloader.lnk"
# Delete Salesforce folder
Foreach ($userprofile in $userprofiles)
{
$SalesforcePath = "C:\Users\$userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Salesforce"
Remove-Item $SalesForcePath -Recurse
}
Salesforce Dataloader requires Azul OpenJDK in order to run. I packaged OpenJDK separately and deployed it as a dependency for Dataloader:
Install:
zulu11.39.15-ca-jdk11.0.7-win_x64.msi /qb-! /L*v C:\logs\mylogfile.log
Uninstall:
msiexec.exe /X {1B2FFD3B-2B88-4EB2-9255-95942B1437CF} /qb-! /L*v C:\logs\mylogfile.log
View inventory records anonymously contributed by opt-in users of the K1000 Systems Management Appliance.