Hi all
Really liking the NAppUpdate framework. I've successfully implemented into an application and it works well ... up to a point.
The issue arises because we merge the separate .exe and .dlls (including the NAppUpdate.Framework.dll) into a single, portable .exe file for deployment. Just in advance of a "cold update" (inside NauIpc.ExtractUpdaterFromResource), NAppUpdate extracts a copy of NAppUpdate.Updater.exe from itself and saves to %APPDATA%\foo.exe. So far so good. But a copy of NAppUpdate.Framework.dll is also required in that folder. NAppUpdate tries to supplies this as follows
// Now copy the NAU DLL
var assemblyLocation = typeof(NauIpc).Assembly.Location;
File.Copy(assemblyLocation, Path.Combine(updaterPath, "NAppUpdate.Framework.dll"), true);
However, remember that NAppUpdate.Framework.dll has been merged (along with all the other DLLs) into a single portable .exe. Therefore, in the code snippet above, assemblyLocation contains the full path and filename of the .exe and it is this which gets copied to the %APPDATA% folder and named NAppUpdate.Framework.dll.
Then when foo.exe is launched it terminates almost immediately leaving a BadImageFormatException in the Windows Application Event log.
Can anyone suggest a workaround? I still want to have a single portable exe. Perhaps NAppUpdate.Updater.exe could be built so that it has no external dependencies? What does the rest of this group think?
Thanks in advance
Matthew