+ Reply to Thread
Results 1 to 3 of 3

Automatically uninstall, unload & delete outdated XLAM

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Automatically uninstall, unload & delete outdated XLAM

    This thread builds on what was solved here: http://www.excelforum.com/excel-prog...rk-folder.html

    Now that the updated version of the Add-In can be detected & installed, I need to:
    1. Uninstall the previous AddIn
    2. Delete the previous AddIn XLAM from the Users Library path
    3. Delete the previous version entry in the AddIns Library

    I don't expect any difficult with 1 & 2. However 3 is a different matter. Leaving aside the possibility (if it is one) of detecting & deleting the registry key for the old addin entry, does any one have any suggestions? (As a starter, I am toying with the idea of trying to "install" the previous addin after the XLAM is deleted and then using Send Keys to select Yes to the message ~ your addin is missing, do you wish to delete this entry)
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Automatically uninstall, unload & delete outdated XLAM

    Solved.

    The attached XLAM will check 3 specified folders for a XLAM with a higher version file name. If a likely candidate is found, it will ask the user if they wish to install a newer version. If the user accepts, the outdated version is uninstalled & the new version is installed. On Workbook_BeforeClose event, the XLAM will check the Users Library path. If an outdated version is found in there, the user is asked if it is OK to delete the outdated version. (I could have had a silent delete but I am not 100% certain about the isNameLower code. Please PM me if you find it reporting false positives).

    To test this:
    1. Download the XLAM
    2. Copy the XLAM into your User Library Path and install the add-in
    3. Open the XLAM in VBA Editor and change at least one of the paths to match a directory on your system. Save the XLAM
    4. Copy the XLAM from the User Library Path into the test path you specified in the previous step. Rename the copied XLAM so it is v2 instead of v1 (so a higher version will be detected)
    5. Open a new workbook
    Attached Files Attached Files
    Last edited by mc84excel; 03-26-2013 at 10:41 PM.

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Talking Re: Automatically uninstall, unload & delete outdated XLAM

    Improved.

    To test this:
    1. Download the XLSM
    2. Save the XLSM as a XLAM and install/load this as an add-in
    3. Create a new folder at C:\TEST\ (if you want to use a different location, change the update folder paths in the 2nd module "AddIn_Setup_UpdaterTest")
    4. Browse to your add-ins folder and copy the XLAM to C:\TEST\
    5. Rename the XLAM in C:\TEST\ so that it has a higher version (e.g. v2.2)
    6. Upon next WB open, the loaded XLAM will prompt user for update to new version


    If you prefer that the user is prompted for deletion of the old XLAM, this can also be set by changing the DeleteOldAddInsFromLibPath argument.

    If you prefer the add-in silent updates, this can be easily done by removing the latter part of blnToInstallUpdatedAddIn procedure.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1