mirror of
https://github.com/Pro/dkim-exchange.git
synced 2026-04-25 08:55:52 +03:00
[GH-ISSUE #102] Updgrade should use newly downloaded Configuration.exe #79
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rbfajardo on GitHub (Oct 27, 2015).
Original GitHub issue: https://github.com/Pro/dkim-exchange/issues/102
I am getting an error when upgrading DKIM from 2.1.6 to 2.1.7.
Your Microsoft Exchange version isn't supported by the DKIM agent: 15.0.1130.7
I upgraded Exchange 2013 to CU10
Attached screenshot of error and version in hex
@Pro commented on GitHub (Oct 27, 2015):
That's strange. It should be supported, at least the version is mentioned in the constants:
https://github.com/Pro/dkim-exchange/blob/master/Src/Configuration.DkimSigner/Constants.cs#L38
Are you sure that you upgraded to 2.1.7? Because the second screenshot mentiones
2.1.5. You can check the Properties Dialog of the .exe file (using Windows Explorer)@gogglespisano commented on GitHub (Oct 27, 2015):
I don't know if it's related, but when I do the update or reiinstall option, it updates all the files except Configuration.DkimSigner.exe which has an in use error, so the UI says 2.1.5 but almost all the files are actually 2.1.7.
@rbfajardo commented on GitHub (Oct 27, 2015):
My mistake, I did not launch the 2.1.7 "Configuration.DkimSigner" executable. I thought I could launch the existing one and do an online update. After launching the correct version of the executable, the installer updated the files.
@Pro commented on GitHub (Oct 27, 2015):
This may be the root cause for this problem... When the Update process is launched, the old dkim signer should close, but it seems that it is hanging somewhare and thus not closing which causes the copy operation to fail.
Maybe this bug was introduced in 2.1.5 where we updated the install process (https://github.com/Pro/dkim-exchange/releases/tag/v2.1.5).
The upgrading still needs some improvement (e.g. check if Configuration.DkimSigner is still running)
@rbfajardo Online Update should theoretically work, but due to the bug described, it still launches the old version.
@AlexLaroche commented on GitHub (Oct 27, 2015):
The main problem is that we should load Constants.cs from a XML file that we can get versions of supported Exchange. During the upgrade process, we just have to load the new version of the xml file.
The problem is here in the code. (Install function in InstallWindow.cs)
@Pro commented on GitHub (Oct 28, 2015):
The Constants.cs file is probably not the problem why the Configuration.exe doesn't close?
Creating an XML file just moves the constants into another place, so this wouldn't change much. It even makes the code more complex.
Maybe it's better to create an installer instead of the current approach? I.E. using Inno Setup.
Then the Configuration.exe downloads the installer and executes it. This will result in a more robust way for copying and installing the files. And it may be easier for users to install the signer.
@AlexLaroche commented on GitHub (Oct 28, 2015):
The Constants.cs is part of the executable. You can't close the file without reaload the executable.
The variable DKIM_SIGNER_VERSION_DIRECTORY should be in a XML file that we can load and unload having to restart the configuration application.
If you want to try to create a installer you cant try but your installer will have to be able to call external program to call powershell.
@gogglespisano commented on GitHub (Oct 28, 2015):
Even if you put those values in an XML file, at some point you have to launch another process/installer AND close the current configuration executable or you wont be able to upgrade it during the install without an unnecessary reboot.
@Pro commented on GitHub (Oct 28, 2015):
Yes, that's why I don't see any advantage using XML instead of Constants.cs
But Alex is also right, that an installer wouldn't be that simple since it needs to call some Powershell Snippets.
So as a conclusion:
We need to improve our install process and find out why the Configuration.exe isn't properly closed here: https://github.com/Pro/dkim-exchange/blob/master/Src/Configuration.DkimSigner/MainWindow.cs#L582
I think that one of the threads running in the background isn't stopped properly.
@AlexLaroche commented on GitHub (Oct 28, 2015):
Configuration.exe is properly closed. The problem isn't there.
The executable currently reload itself, not the new Configuration executable that will be downloaded later in the install process.
We can use Shadow Copy (http://blogs.msdn.com/b/junfeng/archive/2004/02/09/69919.aspx) feature to load the executable in memory and overwrite the existing executable be cause the file will not be lock (Shadow Copy).
After the new files is copied, we can load the new executable to complete the install process with a specific switch like "-install-continue".
@Pro commented on GitHub (Oct 28, 2015):
Ok, then we shouldn't wonder why updating fails!
My first version launched the newly downloaded .exe, which is the right way to do it. (See
github.com/Pro/dkim-exchange@a2e69eaa15 (diff-80fbe89954)).But it seems that this was changed during some refactoring, which is bad.
Using the just downloaded .exe allows us to fix bugs in the install process if the old exe fails and of course doesn't lock the currently installed files.
I will change this back as it was.
@AlexLaroche commented on GitHub (Oct 29, 2015):
Download the package "Configuration.DkimSigner.zip" from the lastest release, extract the content and execute the "Configuration.DkimSigner.exe" from MainWindow.cs.
You could take example on what have been done in InstallWindow.cs.
The problem could be solve without rollback all the code changes. If you rollback all the changes, you will reintroduce thread bugs that is bad too. A lot of work have been done to make them work without bugs.
@Pro commented on GitHub (Oct 29, 2015):
Sorry, my comment wasn't really clear.
I did not mean to rollback the code but to change this behavior back to the old one using the current code
@gogglespisano commented on GitHub (Oct 31, 2015):
I installed 2.1.8 and I was then able to reinstall without getting the file in use error.