AddInCustomAction not working properly
-
Hi, I have write an AddInCustomAction that must be performed before the Installation. I did something like:
public override void Install(IDictionary stateSaver)
{
///
//here is the code that should run before the installation
// pseudo code:
// if (MyFile.txt exist)
// remove_file();
///base.Install(stateSaver);
}This doesn't work properly. the file MyFile.txt exists (and so should be removed) but after installation it still exists!! Any Idea? Thanks
-
Hi, I have write an AddInCustomAction that must be performed before the Installation. I did something like:
public override void Install(IDictionary stateSaver)
{
///
//here is the code that should run before the installation
// pseudo code:
// if (MyFile.txt exist)
// remove_file();
///base.Install(stateSaver);
}This doesn't work properly. the file MyFile.txt exists (and so should be removed) but after installation it still exists!! Any Idea? Thanks
You should show your real code - posting pseudocode won't help us solve the issue.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
You should show your real code - posting pseudocode won't help us solve the issue.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
Sorry, Here is the code:
public override Install(IDictionary stateSaver)
{
String path = this.Context.Parameters["targ"].ToString();
DirectoryInfo dir = new DirectoryInfo(path);
foreach (FileInfo f in dir.GetFiles())
{
if (f.Name == "MyFile.txt")
File.Delete(f.FullName);
}base.Install(stateSaver);
}