Announcement

Collapse
No announcement yet.

Shared Files / Uninstaller does not delete file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Shared Files / Uninstaller does not delete file

    Hi,

    There is a strange behavior in my setup and I hope you can help...

    I have a DLL that is part of a package in the setup project.
    In the advanced options, I set to "Shared Files" to use the "usage counter".


    The setup.exe installs a DLL into the director, the user specifies.
    So far so good.


    But if I run the uninstaller (from the system's "remove programs")
    the DLL is not deleted. Even if the setup is run only once (so the usage counter should be '1').

    Any ideas how to figure out the reason for this behaviour?
    Where can I see/edit the usage counter for a specific file?

    This problem occurs with any file I want to install with "Shared file" enabled.



    Thank you in advance!

  • #2
    I just ran a test here and did not find anything unusual. You may want to compare this with your own log files.

    I created a new installer project, and added a DLL named Helper.dll to it, marking it as a shared file. The option "Never remove" next to it obviously wasn't checked.

    In the installation log I got this:

    Code:
    [02/02/2015 12:56:25] Success  Install archive file: C:\Program Files\Your Product\Helper.dll
    [02/02/2015 12:56:25] Success  Increment usage count: C:\Program Files\Your Product\Helper.dll (New count = 1)
    [02/02/2015 12:56:25] Success  File added to uninstall list: C:\Program Files\Your Product\Helper.dll
    During the uninstallation of the product, this dialog was shown:

    Click image for larger version

Name:	SCRN-2015-02-02-08.png
Views:	1
Size:	6.8 KB
ID:	284271

    Also, the uninstallation log file shows this:

    Code:
    [02/02/2015 12:56:45] Success  Decrement shared file count: C:\Program Files\Your Product\Helper.dll (New count = 0)
    [02/02/2015 12:58:31] Notice  File marked for removal by shared file count: C:\Program Files\Your Product\Helper.dll
    [02/02/2015 12:58:31] Success  Remove file: C:\Program Files\Your Product\Helper.dll
    What happened here is what I expected, I can't see anything wrong.

    Ulrich

    Comment


    • #3
      Hi Ulrich,

      thank you for your support so far.

      Yes, if I try a new setup project with a single file it works, too.
      But I guess there are many things inside my current project that messes it up.


      For example:
      1) According to the log files, some files have the user counter set to 6, 7, 8, ... it is increased anytime I run the setup.
      The uninstaller does nor decrement the usage counter. How can I reset this counter manually?
      Code:
      [02/03/2015 09:17:10] Success	Install archive file: D:\TEST\Driver.dll
      [02/03/2015 09:17:10] Success	Increment usage count: D:\TEST\Driver.dll (New count = 10)
      [02/03/2015 09:17:10] Success	File added to uninstall list: D:\TEST\Driver.dll
      2) According to the log files, some files are installed properly with usage counter = 1, and
      also uninstalled later.
      Code:
      [02/03/2015 09:17:10] Success	Install archive file: D:\TEST\\Symbols\DRIVER.bmp
      [02/03/2015 09:17:10] Success	Create folder: D:\TEST\\Symbols\
      [02/03/2015 09:17:10] Success	Increment usage count: D:\TEST\\Symbols\DRIVER.bmp (New count = 1)
      [02/03/2015 09:17:10] Success	File added to uninstall list: D:\TEST\\Symbols\DRIVER.bmp
      Any ideas?
      How can I reset the usage counter manually?

      Comment


      • #4
        Hi Ulrich!

        I solved it!

        The setup produces this behavior (well installation, but bad installation) when your installation path has a backslash
        as terminating character, e.g.:

        Code:
        D:\MyProduct[B]\[/B]
        If you remove the last character by hand, it will work.


        Solution
        This is how I check for the backlash now, including removing it:

        Code:
        -- get length of the path
        size = String.Length(value.Text);
        
        -- find a backslash at the end
        target_index = String.Find(value.Text, "\\", size-1, false);
        
        -- if there was any...	
        if (target_index > -1) then	
        
          -- ...redirect main dir (AppFolder)
          strLeft = String.Left(value.Text, target_index-1);
          SessionVar.Set("%MAINDIR%", strLeft);
        
        		
        -- otherwise take the origin path
        else
          SessionVar.Set("%MAINDIR%", value.Text);
        end
        Last edited by AutoPlayUser; 02-03-2015, 02:34 AM.

        Comment


        • #5
          How can I reset the usage counter manually?

          Comment


          • #6
            To inspect the usage counters, check the registry at
            Code:
            HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs
            Ulrich

            Comment

            Working...
            X