locked
Smart Client Install/Uninstall broken RRS feed

  • Question

  • Howdy all,

    I have a smart client application that is giving me an error when I try to install it (error text below).  There is an interesting twist though that is likely causing the error.  I recently developed this application in the hopes of making it a smart client.  The server where the smart client application will be hosted does nto have the .NET 2.0 framework installed.  It is not expected to be installed until sometime next year.  In the mean time, it was decided to make a standard windows installer for it.

    Here's where the problems started.  The solution has a Windows Installer project in it.  The main project is also configured to be published as a smart client.  It seems that during my testing, I accidentally installed both the windows installer version and the smart client version of the application on my computer.  When I removed one of them via the control panel add/remove programs, it broke the uninstall for the other one.  Now I can't install or uninstall the smart client version of the application.  I get the error listed below.  Does anybody have any suggestions on how to remedy this?

    Thanks,
    Dan

    --------------------Error Popup--------------------

    "Application cannot be started.  Contact the application vendor." [OK] [Details]

    --------------------End Error Popup--------------------

    When I click the [Details] button, I get the following information (relavent information pasted here):

    --------------------Begin Log--------------------
    APPLICATION SUMMARY
        * Installable application.

    ERROR SUMMARY
        Below is a summary of the errors, details of these errors are listed later in the log.
        * Activation of http://localhost/proj/Applications/SmartClients/MyApplication/MyApplication.application resulted in exception. Following failure messages were detected:
            + Shortcuts could not be removed. Try again later.
            + The directory is not empty.


    COMPONENT STORE TRANSACTION FAILURE SUMMARY
        No transaction error was detected.

    WARNINGS
        There were no warnings during this operation.

    OPERATION PROGRESS STATUS
        * [11/21/2005 3:43:25 PM] : Activation of http://localhost/proj/Applications/SmartClients/MyApplication/MyApplication.application has started.
        * [11/21/2005 3:43:25 PM] : Processing of deployment manifest has successfully completed.
        * [11/21/2005 3:43:25 PM] : Installation of the application has started.
        * [11/21/2005 3:43:26 PM] : Processing of application manifest has successfully completed.
        * [11/21/2005 3:43:28 PM] : Request of trust and detection of platform is complete.
        * [11/21/2005 3:43:29 PM] : Downloading of subscription dependencies is complete.
        * [11/21/2005 3:43:29 PM] : Commit of the downloaded application has started.

    ERROR DETAILS
        Following errors were detected during this operation.
        * [11/21/2005 3:43:31 PM] System.Deployment.Application.DeploymentException (InvalidShortcut)
            - Shortcuts could not be removed. Try again later.
            - Source: System.Deployment
            - Stack trace:
                at System.Deployment.Application.ShellExposure.RemoveShortcuts(ShellExposureInformation shellExposureInformation)
                at System.Deployment.Application.ShellExposure.UpdateShortcuts(SubscriptionState subState, ShellExposureInformation& shellExposureInformation)
                at System.Deployment.Application.ShellExposure.UpdateSubscriptionShellExposure(SubscriptionState subState)
                at System.Deployment.Application.SubscriptionStore.CommitApplication(SubscriptionState subState, CommitApplicationParams commitParams)
                at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState subState, ActivationDescription actDesc)
                at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
                at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
            --- Inner Exception ---
            System.IO.IOException
            - The directory is not empty.

            - Source: mscorlib
            - Stack trace:
                at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
                at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive)
                at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive)
                at System.Deployment.Application.ShellExposure.RemoveShortcuts(ShellExposureInformation shellExposureInformation)
    --------------------End Log--------------------
    Tuesday, November 22, 2005 1:48 PM

Answers

  • The shortcut folder on your start menu may be locked in some way preventing ClickOnce from creating new shortcuts. Can you try deleting the shorcut folder manually and then trying the install again. To delete the shortcut folder navigate to "%userprofile%\Start Menu\Programs" and delete the folder corresponding to your Publisher Name.

    If you're not sure of this name open your .application file and look for: <description publisher="XYZ" />, you want to delete "XYZ" folder to make sure it's not locked.

    If you get Access Denied error trying to delete this folder most likely some other process is holding on to it. Kill the process that's locked this folder and try again. To determine which process is holding the lock you can use procexp.exe tool available at sysinternals.com. Or reboot the machine to reset any locks, that should fix it as well.

    Let us know if you're still seeing the same error.

    Regards,
    Sameer

    Tuesday, November 22, 2005 7:44 PM

All replies

  • The shortcut folder on your start menu may be locked in some way preventing ClickOnce from creating new shortcuts. Can you try deleting the shorcut folder manually and then trying the install again. To delete the shortcut folder navigate to "%userprofile%\Start Menu\Programs" and delete the folder corresponding to your Publisher Name.

    If you're not sure of this name open your .application file and look for: <description publisher="XYZ" />, you want to delete "XYZ" folder to make sure it's not locked.

    If you get Access Denied error trying to delete this folder most likely some other process is holding on to it. Kill the process that's locked this folder and try again. To determine which process is holding the lock you can use procexp.exe tool available at sysinternals.com. Or reboot the machine to reset any locks, that should fix it as well.

    Let us know if you're still seeing the same error.

    Regards,
    Sameer

    Tuesday, November 22, 2005 7:44 PM
  • Sameer,

    You are correct.  I don't know how, but the shortcut's folder in my start menu was causing the problem.  When I renamed the folder, I was able to uninstall/reinstall the application.

    Thanks,
    Dan
    Monday, November 28, 2005 7:33 PM
  • Same problem here but in my case there isn't a Start Menu directory or shortcut to delete.  I have 8 machines with an app deployed two of them are giving me problems. 

        * Exception occurred during uninstall of application CRMS.application, Culture=neutral, PublicKeyToken=148087c38660e2ae, processorArchitecture=msil. Following failure messages were detected:
            + Shortcuts could not be removed. Try again later.
            + The directory is not empty.

    I was able to reproduce the problem on my development machine and removing the shortcut fixed the problem.  My two computers with problems though don't have any shortcuts to remove.  Installation of a new update fails as does an uninstall.
    Monday, January 23, 2006 7:55 PM
  • I Have the same shortcut problem and when I rename the startup folder menu the application install/uninstall correctly. You have point where is the problem exactly, that is really helpfull and great , but the problem is still there! My question is "why does ClickOnce have SOMETIMES problems with existing menu folder?".

    There is an example:

    Before the installation of the application. Computer 1 : In the startup menu, I have an existing folder

    C:\Documents and Settings\userName\Start Menu\CompanyName.

    This folder already contains some subfolders and shortcuts. The folder isn't read only, but contained shortcuts are. It doesn't suppose to have any incidence, but I tried it anyway. If I try to remove the readonly property on the shortcuts, WinXP doesn't let me do it; the readonly still there.

    When We install the application everything works well; the application installs and updates correctly.

    Computer 2: Same parameters and configuration as computer 1; it does already have the folder and the same readonly configuration; the application fail to add the shortcut to the startup menu at installation dans at update.

    My point is, I know that I can install the application by renaming the folder, but I cannot go to every user computer to rename manually the folder for each installation and update!! If I could understand what is different from computer 1 and 2 that causes the problem, I might be able to correct the bug in a cleaner way that simply renaming. Trying to add a custom setup that renames the folder for me and the start the ClickOnce application after seems really patchy to me.

    The problem isn't on the shortcut itself because it desn't exists yet when we first install the application. The problem doesn't seems to be on the folder itseft because it isn't readonly and ClickOnce is supposed to not try to remove it if it already contains something else.

    Anybody have an Idea?  

     

    Thursday, April 20, 2006 4:06 PM
  • I've just had this problem too. There were no shortcuts that I could delete although the log says it can't remove them. The uninstall failed, as did the restore.

    To remove the problem, I had to search the registry for entries and folders containing my project name, and remove them completely. Obviously you must be careful doing this as you can do some damage if you remove the wrong thing. There were only two or three entries that were worth removing as the others were concerned with Visual Studio 2005 (recent projects etc.).

    It worked, the entry in Add or Remove Programs had vanished and the PC allowed me to install a new version of my application.

    Monday, November 27, 2006 11:49 AM
  • My current workaround:
    Choose a unique publisher name for your application in "Project Properties\Publish\Options\Publisher Name". Easiest solution: set Publisher Name = "Company + Product Name". This seems consistent with the naming of the folders in Microsoft products. They are all called "Microsoft Office" and "Microsoft SQL Server" for example.

    This way the application specific shortcut folder in start menu is only used by this one ClickOnce installation. It always raises an error if shortcuts to other programs are in the same directory.

    Fixing a broken installation (as already described by others):
    -Rename the shortcut directory of the application in start menu (I append a _ to the name).
    -Then uninstall the clickonce application (this succeeds now).
    -Finally restore the original name of the short cut directory (remove the _).

    Background:
    I was experiencing this problem too. The uninstall code in ClickOnce seems to assume very strictly, that it is the only one having any files in its directory in the start menu. So first it removes its own shortcuts (if there are any left) and if the directory is still not empty, it raises an error. To be honest this is close to being a showstopper for using ClickOnce at all. (scenario: smart clients with full trust that get updated often). It's very easy to reproduce on my machine.

    Thursday, January 4, 2007 7:45 PM
  • I opened an incident with MS on this because an MS feedback (bug report)  noted it was fixed.   Turns out the catch is that it is only fixed in the VS2005 sp for Vista and in Orcas.   Bottom line is that most of us will just have to use the work around (or not use click once).
    Tuesday, February 13, 2007 10:13 PM