I'm trying to get an installer working where RabbitMQ is involved. The services and dependencies can all be installed without issue, but I'm having trouble getting it to recognize a node name that I'm setting in the system environment variables. The core issue is that the PC/host name is being changed as part of a third party deployment process, which breaks Rabbit entirely.
The system environment variable (RABBITMQ_NODENAME
) is added by a simple console executable at the start of the Wix bootstrapper.
I suspect it's because the installer doesn't get the memo about the updated variables, so when the RabbitMQ installer runs later in the Wix chain it just uses the default Rabbit node name.
My latest attempt to resolve has an additional console executable at the end of the chain that runs the following commands in the Rabbit sbin/
directory in order to try to "refresh" the Rabbit installation:
FireRabbitBatchProcess("rabbitmq-service.bat", "remove");
FireRabbitBatchProcess("rabbitmq-service.bat", "install");
FireRabbitBatchProcess("rabbitmq-service.bat", "start");
...
private static void FireRabbitBatchProcess(string fileName, string arg)
{
string rabbitScriptsPath = @"C:Program FilesRabbitMQ Server
abbitmq_server-3.6.5sbin";
string batchFilePath = Path.Combine(rabbitScriptsPath, fileName);
if (File.Exists(batchFilePath))
{
TryLog("FireRabbitBatchProcess: Running " + batchFilePath + " with argument " + arg);
Process proc = new Process { StartInfo = new ProcessStartInfo() { FileName = batchFilePath, Arguments = arg } };
proc.Start();
proc.WaitForExit(60 * 1000);
}
else
{
TryLog("FireRabbitBatchProcess: This batch file does not exist! " + batchFilePath);
}
}
But this doesn't appear to work either. However, if I run those commands myself after installation it will work fine.
Is there an obvious way I'm missing that can install Rabbit and have it use a specific node name such that PC name changes don't break it?
question from:https://stackoverflow.com/questions/65600936/install-rabbitmq-using-wix-and-set-node-name