Skip to content

Commit

Permalink
add nsis check for environment var (#6185)
Browse files Browse the repository at this point in the history
* add nsis check for environment var

* add changelog
  • Loading branch information
mattdurham authored Jan 18, 2024
1 parent 2e41841 commit 3cc7901
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Main (unreleased)
- Fix a duplicate metrics registration panic when sending metrics to an static
mode metric instance's write handler. (@tpaschalis)

- Fix issue where installing the Windows Agent Flow installer would hang then crash. (@mattdurham)

### Other changes

- Removed support for Windows 2012 in line with Microsoft end of life. (@mattdurham)
Expand Down
12 changes: 8 additions & 4 deletions packaging/grafana-agent-flow/windows/install_script.nsis
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,14 @@ Function InitializeRegistry
Pop $0 # Ignore return result
${EndIf}

# Define the environment key, which holds environment variables to pass to the
# service.
nsExec::ExecToLog 'Reg.exe add "${REGKEY}" /reg:64 /v Environment /t REG_MULTI_SZ /d "$Environment"'
Pop $0 # Ignore return result
nsExec::ExecToLog 'Reg.exe query "${REGKEY}" /reg:64 /v Environment'
Pop $0
${If} $0 == 1
# Define the environment key, which holds environment variables to pass to the
# service.
nsExec::ExecToLog 'Reg.exe add "${REGKEY}" /reg:64 /v Environment /t REG_MULTI_SZ /d "$Environment"'
Pop $0 # Ignore return result
${EndIf}

Return
FunctionEnd
Expand Down

0 comments on commit 3cc7901

Please sign in to comment.