I am having a very annoying problem.
I have an application with a setup project included in the solution that builds a .msi. I use VS 2008. I have incremented the version of the setup project - selected the project in solution explorer, pressed F4, and incremented version, and modified "Manufacturer" and "Author" fields. I then rebuilt the application and the setup project also afterwards.
The most bizarre thing happens then: when I run the resulting .msi file in a non-silent manner, it installs the latest version in the correct C:\Program Files (x86)[Manufacturer]\ path.
But when I call the setup file from the application code, with the silent arguments:
processStartInfo.Arguments = "/i " + "\"" + file + "\"" + "/qn";
...then it installs the previous version (the one before incrementing the setup project version) and also it installs it in the old manufacturer path.
Is the .msi setup file storing two versions inside it that hold different variables/ setup properties?! I am stumped and very annoyed, I have now lost four hours on this issue. I have deleted temp files. I have verified the correct .msi is in the correct path a dozen times.
I need to force the .msi to consider the updated setup properties when installing with silent argument as well.
Here is the code from the application that calls the setup:
private static void RunSetupFile()
{
string file = Path.Combine(Utils.GetAppTempPath(), Utils.ApplicationUpdate_SetupFileName);
ProcessStartInfo psi = new ProcessStartInfo(Path.Combine(Environment.SystemDirectory, "msiexec.exe"));
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.Arguments = "/i " + "\"" + file + "\"" + "/qn";
psi.UseShellExecute = true;
psi.Verb = "runas";
try
{
Process process = Process.Start(psi);
}
catch (System.ComponentModel.Win32Exception)
{
}
}
And below is the code that calls the above method, perhaps here is the culprit:
public static void InitializeAppUpdate()
{
DownloadNewSetupVersionFromServer();
RunSetupFile();
Utils.CloseApplication();
}
Thank you for any idea. Let me know if I should provide more details.