Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: move the ERLANG_HOME configuration to the startup script #782

Open
Gsantomaggio opened this issue Apr 29, 2016 · 1 comment
Open
Assignees
Labels
enhancement pkg-windows An issue specific to Windows

Comments

@Gsantomaggio
Copy link
Member

Move the ERLANG_HOME configuration to the startup script and remove it form the setup.
The setup script has to find the erlang path itself if there is no ERLANG_HOME.

@Gsantomaggio Gsantomaggio added pkg-windows An issue specific to Windows enhancement labels Apr 29, 2016
@Gsantomaggio Gsantomaggio self-assigned this Aug 22, 2016
@Gsantomaggio
Copy link
Member Author

To avoid to use the ERLANG_HOME the cmd tools have to query the windows registry.

I tried to implement it, but (obviously) works only as admin. The RabbitMQ cmd tools work also with the standard users, so it is not possible to apply the fix I tried.

For now I'd leave the setup as it.

Thoughts ?

Since I spent time on it, I report it here, maybe it is useful for the future.

call :finderlang "/reg:64" KEY_64
if "%KEY_64%"=="" ( 
   call :finderlang "/reg:32" KEY_32
   echo KEY 32 "%KEY_32%"

   if "%KEY_32%"=="" ( 
      echo "not found" 
   ) else (
   ERLANG_HOME = %KEY_32%
   )   
) else  ERLANG_HOME = %KEY_64%


:finderlang
setlocal
for /f "skip=2" %%a in ('reg query HKEY_LOCAL_MACHINE\Software\Ericsson\Erlang %1 ') do (
  ( endlocal
  FOR /F "tokens=2*" %%L IN ('reg query %%a %1 /v "" ') DO (
       set "%~2=%%M"
    )
   )
 )
exit /b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement pkg-windows An issue specific to Windows
Projects
None yet
Development

No branches or pull requests

1 participant