Automatic license installation

Skip to first unread message

Árni Steingrímur Sigurðsson

Jun 5, 2019, 6:15:58 AM6/5/19
to StarUML
I tried to raise this issue via twitter:

I manage installed programs for user computers via Saltstack.

The best software can be installed unattended (yours is, you only need to run the installer).

Even better is if I can activate the license without involving the user.

I can't find any documentation if this is possible or how.

Any help would be greatly appreciated. 

Mason Long

Apr 3, 2024, 6:17:19 PMApr 3
to StarUML
Hi Árni. I was looking for the same solution but only found your unanswered question.

I got this figured out by leveraging ActiveSetup after the silent install string is invoked in my silent install script:

Portion to append to your PowerShell silent install script (assumes silent install script, license.key file, and license.cmd helper script called by ActiveSetup are all in the same directory alongside "StarUML Setup 6.0.1.exe"):
$InstallDirectory = split-path -parent $MyInvocation.MyCommand.Definition
# Copy license file (HSU is just our short-hand staging area for common customizations)
New-Item -Path "$ENV:ProgramData\HSU" -Name "StarUML" -ItemType Directory -Force
Copy-Item -Path $InstallDirectory\License.key -Destination "$ENV:ProgramData\HSU\StarUML" -Force

# ActiveSetup to stage license.cmd helper script for copying license.key to %APPDATA%
Copy-Item -Path $InstallDirectory\license.cmd -Destination "$ENV:ProgramData\HSU\StarUML" -Force
New-Item -Path Registry::'HKLM\Software\Microsoft\Active Setup\Installed Components\StarUML' -Force
New-ItemProperty -Path Registry::'HKLM\Software\Microsoft\Active Setup\Installed Components\StarUML' -Name StubPath -PropertyType String -Value 'CMD /C %PROGRAMDATA%\HSU\StarUML\license.cmd"' -Force
New-ItemProperty -Path Registry::'HKLM\Software\Microsoft\Active Setup\Installed Components\StarUML' -Name Version -PropertyType String -Value '1,0,0,0' -Force

Contents of license.cmd helper script to be invoked by ActiveSetup:

Set loc=%~dp0

:Create directory structure
mkdir %APPDATA%\StarUML

:Copy License.key to %APPDATA%
copy "%loc%License.key" "%APPDATA%\StarUML\License.key"


This will take affect on the next login for all new and existing users because license.cmd will be run in the user's context upon login which copies license.key to their respective %APPDATA%\StarUML directory.
Reply all
Reply to author
0 new messages