dakota97
Centurion
Hi all,
It's been a while since I've posted here, but I haven't forgotten all of you, and I'm back with another strange issue.
I'm using VS2008 and I've created a standard deployment project for my app. I've created a custom installer class to override the standard one simply to delete a configuration file based on the user's selection during the install. This way I can have one package to deploy both version of the program, and the user selection determines which version is installed. Simple enough right?
The problem is that each time the application is started, the Windows Installer appears and "re-installs" the application. This in turn puts both configuration files back in the application directory. It appears that my customer installer is run during this process, but since there is no selection, it doesn't delete either of the 2 files.
So, in short, why is the installer running each time the application is started? Any ideas would be greatly appreciated. My code for the custom installer is as follows:
Thanks in advance,
-Chris
It's been a while since I've posted here, but I haven't forgotten all of you, and I'm back with another strange issue.
I'm using VS2008 and I've created a standard deployment project for my app. I've created a custom installer class to override the standard one simply to delete a configuration file based on the user's selection during the install. This way I can have one package to deploy both version of the program, and the user selection determines which version is installed. Simple enough right?
The problem is that each time the application is started, the Windows Installer appears and "re-installs" the application. This in turn puts both configuration files back in the application directory. It appears that my customer installer is run during this process, but since there is no selection, it doesn't delete either of the 2 files.
So, in short, why is the installer running each time the application is started? Any ideas would be greatly appreciated. My code for the custom installer is as follows:
Code:
public override void Install(IDictionary stateSaver)
{
string installedVersion = Context.Parameters["Selection"];
string installDirectory = Path.GetDirectoryName(Context.Parameters["assemblypath"]);
//Delete the appropriate configuration file
if (installedVersion == "Standard")
{
if (File.Exists(installDirectory + "\\Configuration.xml"))
File.Delete(installDirectory + "\\Configuration.xml");
}
else if (installedVersion == "Network")
{
if (File.Exists(installDirectory + "\\Config.xml"))
File.Delete(installDirectory + "\\Config.xml");
}
}
Thanks in advance,
-Chris