microsoft / AzureKeyVaultExplorer

Azure Key Vault Explorer
MIT License
210 stars 68 forks source link

Opening vault://myvault from Chrome results in a file not found exception #29

Open cveld opened 4 years ago

cveld commented 4 years ago

When I try to open vault://myvault from Chrome (after installing the ClickOnce app) I get an application error.

The following exception report is provided.

PLATFORM VERSION INFO
    Windows             : 10.0.18363.0 (Win32NT)
    Common Language Runtime     : 4.0.30319.42000
    System.Deployment.dll       : 4.8.3752.0 built by: NET48REL1
    clr.dll             : 4.8.4180.0 built by: NET48REL1LAST_B
    dfdll.dll           : 4.8.3752.0 built by: NET48REL1
    dfshim.dll          : 10.0.18362.1 (WinBuild.160101.0800)

SOURCES
    Deployment url          : file:///C:/Users/caveld/AppData/Roaming/Microsoft/Windows/Start%20Menu/Programs/Microsoft%20Corporation/VaultExplorer.appref-ms%7Cvault://myvault/

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Users\caveld\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Microsoft Corporation\VaultExplorer.appref-ms|vault://myvault/ resulted in exception. Following failure messages were detected:
        + Could not find file 'C:\Users\caveld\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Microsoft Corporation\VaultExplorer.appref-ms'.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    There were no warnings during this operation.

OPERATION PROGRESS STATUS
    * [12-8-2020 15:01:50] : Activation of C:\Users\caveld\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Microsoft Corporation\VaultExplorer.appref-ms|vault://myvault/ has started.

ERROR DETAILS
    Following errors were detected during this operation.
    * [12-8-2020 15:01:50] System.IO.FileNotFoundException
        - Could not find file 'C:\Users\caveld\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Microsoft Corporation\VaultExplorer.appref-ms'.
        - Source: mscorlib
        - Stack trace:
            at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
            at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
            at System.IO.FileInfo.CopyTo(String destFileName)
            at System.Deployment.Application.ApplicationActivator.CleanApplicationReInstall(Boolean isShortcut, Uri deploymentUri, Uri activationUri, BrowserSettings browserSettings, String textualSubId, String errorPageUrl, String deploymentProviderUrlFromExtension, String shortcutFilePath)
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
            at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.
maeof commented 3 years ago

I have noticed that at least on Windows 10 the one-click application installer installs VaultExplorer at a different folder than it's expected by the application itself (there's a hardcoded path in the code which does not match to the fact installation directory).

I. e. The error states that it cannot find the file in AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Microsoft Corporation\VaultExplorer.appref-ms however it installs automatically under AppData\Romaing\Microsoft\Windows\Start Menu\Programs\VaultExplorer\VaultExplorer.appref-ms instead.

I troubleshoot this excact error via editing Registry. If you execute this straight from your cmd window (you do not need administrator rights) this will set the path which is saved in the Registry correctly at least in Windows 10 making the vault:// protocol to work properly:

REG ADD HKCU\Software\Classes\vault\shell\open\command /t REG_EXPAND_SZ /d "\"C:\windows\system32\rundll32.exe\" C:\windows\system32\dfshim.dll, ShOpenVerbShortcut %APPDATA%\Microsoft\Windows\Start Menu\Programs\VaultExplorer\VaultExplorer.appref-ms|%1" /F