Skip to content

Commit 4e4cde1

Browse files
wojtekmachjosevalim
authored andcommitted
Update Windows installer to write Elixir install root to registry (#13157)
We don't need this right now but it could be useful in the future, if anything to detect if Elixir was installed using this installer. Demo: iex> {:ok, r} = :win32reg.open([:read]) iex> :win32reg.change_key(r, ~c"\\hklm\\software\\wow6432node\\elixir\\elixir") iex> :win32reg.value(r, ~c"installroot") {:ok, ~c"C:\\Program Files\\Elixir"}
1 parent e1db6d8 commit 4e4cde1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/elixir/scripts/windows_installer/installer.nsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ Section "Install Elixir" SectionElixir
202202
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Elixir" "NoModify" 1
203203
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Elixir" "NoRepair" 1
204204

205+
WriteRegStr HKLM "Software\Elixir\Elixir" "InstallRoot" "$INSTDIR"
206+
205207
WriteUninstaller "Uninstall.exe"
206208
SectionEnd
207209

@@ -280,6 +282,8 @@ UninstPage custom un.FinishPageShow un.FinishPageLeave
280282
Section "Uninstall"
281283
RMDir /r "$INSTDIR"
282284
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Elixir"
285+
DeleteRegKey HKLM "Software\Elixir\Elixir"
286+
DeleteRegKey /ifempty HKLM "Software\Elixir"
283287
SectionEnd
284288

285289
!insertmacro MUI_LANGUAGE "English"

0 commit comments

Comments
 (0)