-
Notifications
You must be signed in to change notification settings - Fork 30
Copy from "new" location of .erlang.cookie file #82
Conversation
@@ -132,6 +132,7 @@ Section "RabbitMQ Service" RabbitService | |||
ReadEnvStr $1 "HOMEDRIVE" | |||
ReadEnvStr $2 "HOMEPATH" | |||
CopyFiles "$WINDIR\.erlang.cookie" "$1$2\.erlang.cookie" | |||
CopyFiles "$SystemRoot\System32\config\systemprofile\.erlang.cookie" "$1$2\.erlang.cookie" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the source file is missing, CopyFiles
logs an error. That's how I found this issue.
Should we use IfFileExists
before calling CopyFiles
to avoid this error message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would make sense to me.
Thanks @dumbbell I looked in the docs for something like that but couldn't find it. |
👍 let's get this merged and tested :-) |
@@ -131,7 +131,12 @@ Section "RabbitMQ Service" RabbitService | |||
ExecDos::exec /DETAILED '"$INSTDIR\rabbitmq_server-%%VERSION%%\sbin\rabbitmq-service.bat" start' "" | |||
ReadEnvStr $1 "HOMEDRIVE" | |||
ReadEnvStr $2 "HOMEPATH" | |||
CopyFiles "$WINDIR\.erlang.cookie" "$1$2\.erlang.cookie" | |||
IfFileExists "$SystemRoot\System32\config\systemprofile\.erlang.cookie" 0 +5 | |||
CopyFiles "$SystemRoot\System32\config\systemprofile\.erlang.cookie" "$1$2\.erlang.cookie" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder, if .erlang.cookie
already exists from a previous installation, will we get an access error due to permissions? The installer should be running with an admin account but it would be worth testing. I have seen strange "access denied" errors when copying cookies that have required deleting the previous one before copying the new one 🤷♂️
https://www.rabbitmq.com/install-windows-manual.html#erlang-cookie Fixes #81 packaging/windows: Look at Erlang 20.2+ cookie's location as well While here, check if the cookie exists before copying it. This fixes an uninformative error message in the installer output. Use NSIS variable $SYSDIR
ee31a64
to
3ca2365
Compare
@michaelklishin @dumbbell this isn't working right and I'm investigating. |
0adc536
to
72fd1d1
Compare
OK, finally figured it out. Issue copying file was due to X64 redirection. QA steps on my Win 8.1 VM:
|
Let's get this through the pipeline and test the final artifact. |
I confirm it works for me too! Thank you @lukebakken! I was experimenting on my side yesterday as well, but couldn't figure out what was wrong with |
https://www.rabbitmq.com/install-windows-manual.html#erlang-cookie
Fixes #81