Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/sources/set-up/install/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ To do a silent install of {{< param "PRODUCT_NAME" >}} on Windows, perform the f
- `/DISABLEREPORTING=<yes|no>` Disable [data collection][]. Default: `no`
- `/DISABLEPROFILING=<yes|no>` Disable profiling endpoint. Default: `no`
- `/ENVIRONMENT="KEY=VALUE\0KEY2=VALUE2"` Define environment variables for Windows Service. Default: ``
- `/FORCEREGISTRY=yes` At the start of installation, delete all Alloy registry keys and then run the rest of the install as normal so that install options such as `/STABILITY` and `/DISABLEREPORTING` are written fresh.
By default, the installer preserves existing registry values on upgrade; use this flag to reset them and apply the options passed on the command line, and to remove any old or unused registry keys from previous versions.
- `/RUNTIMEPRIORITY="normal|below_normal|above_normal|high|idle|realtime"` Set the runtime priority of the {{< param "PRODUCT_NAME" >}} process. Default: `normal`
- `/STABILITY="generally-available|public-preview|experimental"` Set the stability level of {{< param "PRODUCT_NAME" >}}. Default: `generally-available`
- `/USERNAME="<username>"` Set the fully qualified user that Windows uses to run the service. Default: `NT AUTHORITY\LocalSystem`
Expand Down
11 changes: 10 additions & 1 deletion packaging/windows/install_script.nsis
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Var StabilityFlag
Var User
Var Password
Var AuthFlag
Var ForceRegistry

# Pages during the installer.
Page license
Expand All @@ -66,10 +67,19 @@ Section "install"
${GetOptions} $PassedInParameters "/CONFIG=" $Config
${GetOptions} $PassedInParameters "/USERNAME=" $User
${GetOptions} $PassedInParameters "/PASSWORD=" $Password
${GetOptions} $PassedInParameters "/FORCEREGISTRY=" $ForceRegistry

# Calls to functions like nsExec::ExecToLog below push the exit code to the
# stack, and must be popped after calling.

# When /FORCEREGISTRY=yes, delete all Alloy registry keys at the start so the
# rest of the installation can proceed as normal and write fresh values. This
# also cleans up any old or unused keys from previous versions.
${If} $ForceRegistry == "yes"
nsExec::ExecToLog 'Reg.exe delete "HKLM\SOFTWARE\GrafanaLabs\Alloy" /reg:64 /f'
Pop $0
${EndIf}

# Preemptively stop the existing service if it's running.
nsExec::ExecToLog 'sc stop "Alloy"'
Pop $0
Expand Down Expand Up @@ -174,7 +184,6 @@ Function CreateDataDirectory
Return
FunctionEnd


# InitializeRegistry initializes the keys in the registry that the service
# runner uses. If the registry values already exist, they are not overwritten.
Function InitializeRegistry
Expand Down
Loading