Open kipamgs opened 2 months ago
Hallo, i just create project from template and tested it. It works, but some code looks different.
public void ViewLog()
{
if (Shell != null)
try
{
string logFile = Host?.Runtime.Session.LogFile;
if (logFile.IsEmpty())
{
string wixSharpDir = Path.GetTempPath().PathCombine("WixSharp");
if (!Directory.Exists(wixSharpDir))
Directory.CreateDirectory(wixSharpDir);
logFile = wixSharpDir.PathCombine(Host.Runtime.ProductName + ".log");
IO.File.WriteAllText(logFile, Shell.Log);
}
Process.Start("notepad.exe", logFile);
}
catch
{
// Catch all, we don't want the installer to crash in an
// attempt to view the log.
}
}
code is from fresh generated template without any changes.
Your suggested change does not work for me(Host?.Runtime.Session
instead of the class member session
).
I also reinstalled the wixsharp project templates extension in Visual Studio 2022.
very strange. There should be logfile in temp path and folder WixSharp. If its not , msi doesnt have access to temp path or logfile. check windows eventlog for current datetime and maybe this can give you answer. Does UAC appears or msi runas for another user?
Yes the UAC appears. It works if you just create the project from the template and execute the installer. But as soon as you update the Nuget package to 2.2.0 or newer (at the time of writing 2.3.2 is the newest) it stops working.
With 2.1.7 the Directory (and log file) are created in C:\Users\<username>\AppData\Local\Temp
. The directory is not created with a newer version (tested with 2.3.2).
Bahmm.. Now , only oleg can help you with this. I dont update my project to newest version. But in my msi installer from template, directory and log file are created in windows temp folder, not in user specific. Last sugggestion from me, change Path.GetTempPath() to windows Temp Folder. If still doesnt created dir and file, i cant help you with. unfortunatelly.
Yes, I can confirm now it was a defect. Fixed in the today release.
Since version 2.2.0 there is an exception thrown in the ViewLog method of the ExitDialog and thus the log is not displayed. It is working until version 2.1.7.
This happens when creating a project with
WixSharp Setyp - Custom WPF UI (WiX4)
and then update the nuget version.