Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. AddInCustomAction not working properly

AddInCustomAction not working properly

Scheduled Pinned Locked Moved C#
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lune12
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • L lune12

      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

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      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.

      My blog | My articles | MoXAML PowerToys | Onyx

      L 1 Reply Last reply
      0
      • P Pete OHanlon

        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.

        My blog | My articles | MoXAML PowerToys | Onyx

        L Offline
        L Offline
        lune12
        wrote on last edited by
        #3

        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);
        }

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups