Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I keep .NET applications pinned to the Task Bar during AutoUpdate?

When an application deployed by ClickOnce AutoUpdate is automatically updated on Windows 7, the application becomes unpinnned from the taskbar. Is there a way to stop it from becoming unpinned?

like image 598
ryantm Avatar asked Mar 18 '10 03:03

ryantm


People also ask

How do I permanently pin to taskbar?

From the Start menu or apps list, press and hold (or right-click) an app, then, if available, select Pin to taskbar . From the Start menu or apps list, press and hold (or right-click) an app, then select More > Pin to taskbar .

Can you pin programs on the taskbar?

To pin apps to the taskbarSelect Start , scroll to the app you want to pin, then press and hold (or right-click) the app. Select More > Pin to taskbar. If the app is already open on the desktop, press and hold (or right click) the app's taskbar icon, and then select Pin to taskbar.

Can you pin the apps that you use most often on the taskbar?

Pin the apps you use most often to the Start menu. Here's how: Select Start from the taskbar, then find the app you want to pin in the list or search for it by typing the app name in the search box. Press and hold (or right-click) the app, then select Pin to Start .

What does pinning to taskbar mean?

Pinning a program in Windows 10 means you can always have a shortcut to it within easy reach. This is handy in case you have regular programs that you want to open without having to search for them or scroll through the All Apps list.


2 Answers

When the ClickOnce application is not installed it most likely impossible to achieve this. When it's installed; i'm not sure.

A ClickOnce application is downloaded to the users' temporary directory. When the application downloads the latest version, this version is stored in a new sub directory and not overwritten as which is the case with 'normal' application updates.

like image 137
Rhapsody Avatar answered Oct 21 '22 20:10

Rhapsody


I don't know about keeping it from being unpinned but there is a way using a vbs script to pin an exe which isn't supposed to be doable by code:

Call AddToTaskbar("C:\temp\", "MyExe.exe")

Function AddToTaskbar (Path, File)
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(Path)
    Set objFolderItem = objFolder.ParseName(File)
    Set colVerbs = objFolderItem.Verbs

    For Each objVerb in colVerbs
        If Replace(objVerb.name, "&", "") = "Pin to Taskbar" Then 
            'WScript.Echo objVerb
            objVerb.DoIt
        End If
    Next        
End Function

This essentially relies on the right click menu of an exe having the "Pin to Taskbar" entry. It unfortunately makes it english specific unless someone has a list of all translations.

like image 39
PeteT Avatar answered Oct 21 '22 21:10

PeteT