Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup of EdgeApps incomplete #4

Open
htcfreek opened this issue Aug 2, 2021 · 5 comments
Open

Backup of EdgeApps incomplete #4

htcfreek opened this issue Aug 2, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@htcfreek
Copy link

htcfreek commented Aug 2, 2021

You should additional backup the web app shortcuts in startmenu/desktop (current user) and the corresponding uninstall keys in regedit (hkcu) too.

If you don't do that users could get problems while removing them or adding them to start.

@mardahl
Copy link
Collaborator

mardahl commented Aug 2, 2021

Could you give some code examples?
Thanks

@mardahl mardahl self-assigned this Aug 2, 2021
@mardahl mardahl added the enhancement New feature or request label Aug 2, 2021
@htcfreek
Copy link
Author

htcfreek commented Aug 2, 2021

I planned to upload an complete ps script. But it will take time. On wednesday I might get access to the working script.

But you can find the reg keys and shortcuts (user startmenu and user desktop) by the property of uninstall/destination path. It's edge_proxy.exe or something similar. For getting the shortcut destination you need the shell com object feature.

@htcfreek
Copy link
Author

htcfreek commented Aug 2, 2021

@mardahl
Copy link
Collaborator

mardahl commented Jan 18, 2024

I can backup the PWA shortcuts with this bit of code:

#function to aquire the users PWA shortcuts from the userprofile
function Get-EdgePWAShortcuts{
    #Get all shortcuts from the userprofile and collect in array
    $Shortcuts = Get-ChildItem -ErrorAction SilentlyContinue -Recurse $($env:USERPROFILE) -Include *.lnk
    #Create shell object to analyse shortcut details
    $Shell = New-Object -ComObject WScript.Shell
    foreach ($Shortcut in $Shortcuts)
    {
        #Check if the shortcut is Edge based on the target path (this should be the PWA app)
        if ($Shell.CreateShortcut($Shortcut).targetpath -like "*edge_proxy.exe") {
            $Properties = @{
                ShortcutName = $Shortcut.Name;
                Path = $Shortcut.FullName;
                ShortcutDirectory = $shortcut.DirectoryName
                Target = $Shell.CreateShortcut($Shortcut).targetpath
            }
            #output the shortcut details as a PSObject
            New-Object PSObject -Property $Properties
        }
    }
    #Release the shell object
    [Runtime.InteropServices.Marshal]::ReleaseComObject($Shell) | Out-Null
}

But I don't see how it makes a difference without the registry, which I am not seeing any good docs on how to couple with the PWA shortcuts that have some references in : Computer\HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Mappings

Now I donøt use these PWA, so I won't be a good tester.

Could you perhaps suggest some more code logic if you want this feature added?

@htcfreek
Copy link
Author

I can't help you with this. As some things have changed and my old solution doesn't work anymore, I have removed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants