Back to Documentation

Update Existing Packages

Upgrade your PSADT scripts to new versions while keeping custom code intact.

What is Update Mode?

Update Mode is designed for situations where you have an existing PSADT package and need to update it to a newer version of the application. Instead of creating a new package from scratch, this mode:

  • Preserves your custom pre-installation and post-installation code
  • Keeps custom variables and configurations
  • Updates file paths to match the new installer structure
  • Maintains your enterprise-specific modifications

When to Use Update Mode

✓ Use Update Mode When

  • • Updating to a new application version
  • • Your script has custom pre/post install code
  • • You have enterprise-specific variables
  • • The installer structure is similar

✗ Use New Installation When

  • • Creating a package for a new application
  • • The application has completely changed
  • • You want to start fresh
  • • No custom code to preserve

Step-by-Step Guide

1

Upload New Installer (ZIP)

Upload a ZIP file containing the new version of your installer files. The ZIP should contain the same structure as your original Files folder.

Example ZIP structure:
MyApp_v2.0.zip/
├── Setup_x64.exe
├── Setup_x86.exe
└── config.ini
2

Upload Existing Script

Upload your existing Invoke-AppDeployToolkit.ps1 script. The tool will parse it to extract:

  • Application metadata (name, version, vendor)
  • Custom variables and their values
  • Pre-installation code blocks
  • Post-installation code blocks
  • Custom uninstallation logic
3

Automatic Comparison

The tool compares the old and new file structures and automatically:

  • Maps old file paths to new file paths
  • Detects renamed or moved files
  • Identifies new files that weren't in the original
  • Flags removed files that may need attention
4

Review & Download

Review the updated script with your custom code preserved and file paths updated. The generated package includes:

  • Updated Invoke-AppDeployToolkit.ps1 with new paths
  • All your custom pre/post installation code
  • Enterprise variables intact
  • New installer files in the Files folder

What Gets Preserved

Custom Variables

$ESS_CMDDATAROOT = "C:\Data"
$CustomLogPath = "D:\Logs"
$LicenseServer = "lic.domain.com"

Pre-Installation Code

# Stop services before install
Stop-Service -Name "MyService"
# Backup config files
Copy-Item ...

Post-Installation Code

# Apply registry settings
Set-ItemProperty -Path ...
# Start services
Start-Service -Name "MyService"

Uninstallation Logic

# Clean up user data
Remove-Item -Path ...
# Remove scheduled tasks
Unregister-ScheduledTask ...

Tips for Best Results

Keep similar file names: If possible, use similar naming conventions for installer files. This helps the tool automatically map paths.

Review path mappings: Always verify the automatic path mappings are correct, especially if file names have changed significantly.

Test thoroughly: After updating, test the package in a non-production environment to ensure custom code works with the new version.

Next Steps