The code from Robin article will help you to create the shortcut for your application deployed through ClickOnce.When requested, a windows.Window will contain an array of tabs.Tab objects. System.IO.File.Copy(shortcutName, desktopPath, true) If (company != string.Empty & description != string.Empty)Įnvironment.GetFolderPath(),Įnvironment.GetFolderPath(), (AssemblyDescriptionAttribute)Attribute.GetCustomAttribute(code, If (Attribute.IsDefined(code, typeof(AssemblyDescriptionAttribute)))ĪssemblyDescriptionAttribute asdescription = (Assembl圜ompanyAttribute)Attribute.GetCustomAttribute(code, If (Attribute.IsDefined(code, typeof(Assembl圜ompanyAttribute))) If (ad.IsFirstRun) //first time user has run the app since installation or updateĪssembly code = Assembly.GetExecutingAssembly() If (.IsNetworkDeployed)ĪpplicationDeployment ad = ApplicationDeployment.CurrentDeployment I could just create a simple ".lnk" file and have it be part of my custom installer app, but that doesn't seem as "ClickOnce-like". However, I have not found a way to "association" or "embedded" an icon to that shortcut. The executable (http or file share) of the ClickOnce application.
Because I've hijacked the install process, I would need to handle the creation of shortcut myself in my custom installer. So as I understand it, the problem is not with "publishing" but "installation". For more information, see Element (ClickOnce Application) andShortcutAppId.". A ClickOnce application can also suppress the standard Start menu entry, shortcut,Īnd Add or Remove Programs entry by using a element. For more information, see UpdateCheckInfo.
"A ClickOnce application can also add custom update logic, including a custom user interface to show during the update process. So that disables ClickOnce from creating shortcut and add / remove entry automatically: That entry in manifest would work if I was letting ClickOnce create the shortcut for me. It's not what the "DEFAULT" ClickOnce would have created, but all the same to a user so I've decided it's not worth the time to make it look like the "DEFAULT" ClickOnce installation. Here (which taps into unmanaged windows shell blah blah blah.), to create a true shortcut file ".lnk" with icon embedded and have to it to point to the "appref-ms" file created in step one. Create an application-specific "appref-ms" file and populate its content from "ShortcutAppId" returned from "DownloadApplicationCompleted" event.I just went with alternate solution for now: Is there a trick with InPlaceHostingManager where I can create
Question is, I cannot figure out how to create one like ClickOnce does to have a "appref-ms" file as shortcut and embed an ICON in it. I have no problem creating my own shortcut. So no default shortcut is created for me. Again, in my case, I am using "InPlaceHostingManager" to customize the installation That works only for default ClickOnce installation where a default shortcut is created for you by the "DEFAULT" ClickOnce installer and you simply copy it to another location. Like to be able to create a shortcut just like how ClickOnce does it and able to assign a custom icon to it. lnk file to point to it, but that is not how ClickOnce creates shortcuts. I suppose it could work if I save off the. EXCEPT - I cannot figure out how to associate a custom icon to the "appref-ms" file I created. Basically just a unicode text file with the content of ShortcutAppId that is passed back to InPlaceHostingManager when app download is complete. I am able to create a shortcut like a true ClickOnce shortcut ("appref-ms") and place it in Start menu. A ClickOnce application that acts as a custom installer (InPlaceHostingManager) that handles the custom install / remove / and shortcut creation for the first app.We use snippets from a sample app, which you can download from GitHub (see Sample code ), to demonstrate the various features and associated Windows Ink APIs (see Components of the Windows Ink platform ) discussed in each step. Manifest contains so auto creation of shortcut and an entry in add / remove programs by ClickOnce are disabled. This tutorial steps through how to create a basic Windows app that supports writing and drawing with Windows Ink. I've searched many sources but could not find one that fits my scenario and provides a solution.