AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Everything Else
Sharing a Script - ...
 
Notifications
Clear all

Questions Sharing a Script - Need to change your versions of Acumatica Frequently USE THIS.

 
Everything Else
Last Post by Tim Rodman 12 months ago
2 Posts
2 Users
0 Reactions
516 Views
RSS
Corey Schafer
Posts: 3
 Corey Schafer
Topic starter
May 31, 2024 3:42 pm
(@corey-schafer)
Active Member
Joined: 4 years ago

I am going to start posting some of utility scripts that help me with day to day on-premise tasks with Acumatica.  

Here is a script in PowerShell that I use -  so I don't have to babysit a dev server when I change out the version of Acumatica. 

 

Steps of this script:

  • It verifies that your are an administrate user. 
  • You pick the version of installer out of the directory of installers. 
  • It checks to closes ALL windows for Acumatica ERP Configuration Wizard on all profiles (saving the reboot flag from getting tripped).
  • It silently uninstalls the current version. 
  • And installs Acumatica with an unattended install.  (no prompts) 

 

image

 

Corey Schafer / ERP Technican
 E. corey@benpor.com

Bennett/Porter & Associates, Inc.

 

--

code:  (change the directory to point to your installers)

---------------------------------------------------------------------

 

cls

# Check if the current user has administrative rights
function Test-AdminRights {
$currentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object Security.Principal.WindowsPrincipal($currentUser)
return $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
}

# Check if the user has administrative rights
if (Test-AdminRights) {
Write-Host "User has administrative rights."




Write-Host "Starting Version Switch"
Write-Host "--Please Pick the Version to Install"

# Create OpenFileDialog
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog

#CHANGE HERE !!!
$openFileDialog.InitialDirectory = 'E:\Installers\'



$openFileDialog.Filter = "MSI files (*.msi)|*.msi|All files (*.*)|*.*"
$openFileDialog.Title = "Select an MSI file to execute"
$openFileDialog.Multiselect = $false

# Show OpenFileDialog
$dialogResult = $openFileDialog.ShowDialog()

# Check if an MSI file was selected
if ($dialogResult -eq [System.Windows.Forms.DialogResult]::OK) {
$msiFilePath = $openFileDialog.FileName
Write-Host "Selected MSI file: $msiFilePath"

# Execute the selected MSI file
try {



$windows = Get-Process | ForEach-Object { $_.MainWindowTitle } | Where-Object { $_ -eq "Acumatica ERP Configuration Wizard" }
# Close each window found
foreach ($window in $windows) {
$process = Get-Process | Where-Object { $_.MainWindowTitle -eq $window }
if ($process) {
$process | ForEach-Object { $_.CloseMainWindow() }
Write-Host "Closed window: $window"
} else {
Write-Host "Window not found: $window"
}
}



Write-Host "Checking for Installed Versions of Acumatica"

$MyApp = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -like "Acumatica*"}
if ( $MyApp-ne $null ){
Write-Host "Removing old version"

$MyApp.Uninstall()
Write-Host "Uninstall Complete"
}
Write-Host "Starting Installation"
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i `"$msiFilePath`" /qb" -Wait -NoNewWindow
Write-Host "Acumatica Version Installed Successfully."
} catch {
Write-Host "Error executing MSI file: $_"
}
} else {
Write-Host "No MSI file selected."
}



}
else
{
Write-Host "User does not have administrative rights."
}
1 Reply
Tim Rodman
Posts: 3192
 Tim Rodman
Admin
May 31, 2024 11:51 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Very cool. Thank you so much for sharing.

Reply
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,519 Topics
  • 10.9 K Posts
  • 15 Online
  • 2,309 Members
Our newest member: Jason Rhodes
Latest Post: Hello Everyone ,
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

  • Julie Baker
Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2025 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×