Icon two times in Windows Program and Features
I just created an installer. When I install the app using the Setup.exe appears the icon in the Desktop and in the control panel.
The app has this in its code
using (var mgr = new UpdateManager(@"https://URL.com", "ID", FrameworkVersion.Net45))
{
await mgr.UpdateApp();
}
The strange behavior is that when the the code above runs, the program appears two times in the control panel.

Why could this happen?
@ricardopolo Can you give me a .reg file containing HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall?
Here it is https://dl.dropboxusercontent.com/u/300838/Uninstall.reg
I see two entries, one with the name of the Nuget and one with the name of the Publisher
I also see that in AppData are two folders created

One contains Update.exe and the other one not.
@ricardopolo Your "ID" needs to match the NuGet package ID - we really should just remove this as an option in the constructor
@paulcbetts it matches. My UpdateManger looks like this
using (var updateManager = new UpdateManager(@"https://signtul.blob.core.windows.net/outlook-addin", "Tulpep.Signtul.OutlookAddIn", FrameworkVersion.Net45))
And my NuSpec
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Tulpep.Signtul.OutlookAddIn</id>
<version>$version$</version>
<title>Signtul Outlook AddIn</title>
<authors>Tulpep</authors>
<projectUrl>http://www.signtul.com/</projectUrl>
<iconUrl>http://www.signtul.com/Content/Img/favicon.ico</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Tulpep Signtul Outlook AddIn</description>
</metadata>
@paulcbetts do you know where can I find more information or what nexts steps should we take in order to fix this one?
@ricardopolo Can you send me a built nupkg file?
@paulcbetts off course. Here it is
This is the nupkg https://signtul.blob.core.windows.net/outlook-addin/Tulpep.Signtul.OutlookAddIn-1.0.414-full.nupkg This is the Setup.exe https://signtul.blob.core.windows.net/outlook-addin/Setup.exe This is the Releases file https://signtul.blob.core.windows.net/outlook-addin/RELEASES
This is code called from the Main function of the program
using (var updateManager = new UpdateManager(@"https://signtul.blob.core.windows.net/outlook-addin", "Tulpep.Signtul.OutlookAddIn", FrameworkVersion.Net45))
{
await updateManager.UpdateApp();
}
@ricardopolo Can you try rigging up correct handling of Squirrel-based events? Check out https://github.com/Squirrel/Squirrel.Windows/blob/master/docs/squirrel-events.md for more info - while I haven't found any smoking gun yet, this is definitely a thing you need to fix in your app that would cause the installer to do Weird Stuff.
We have tried:
SquirrelAwareApp.HandleEvents(
onInitialInstall: v => updateManager.CreateUninstallerRegistryEntry(),
onAppUpdate: v => updateManager.CreateUninstallerRegistryEntry(),
onAppUninstall: v => RemoveOutlookAddin()
);
Wit not luck. Looks like it Updates every time (even when Install) and more weird... in every Update the Uninstaller should not be created, isn't it?
Can you instead try:
SquirrelAwareApp.HandleEvents(
onInitialInstall: v => InstallOutlookAddin(),
onAppUpdate: v => InstallOutlookAddin(),
onAppObsolete: v => RemoveOutlookAddin(),
onAppUninstall: v => RemoveOutlookAddin());
Put this code as early as possible in startup.
Added onAppObsolete as recommended
SquirrelAwareApp.HandleEvents(
onInitialInstall: v => updateManager.CreateUninstallerRegistryEntry(),
onAppUpdate: v => updateManager.CreateUninstallerRegistryEntry(),
onAppObsoleted: v => updateManager.RemoveUninstallerRegistryEntry(),
onAppUninstall: v => RemoveOutlookAddin()
);
A new installation:

@ricardopolo I don't think you should be calling XYZUninstallerRegistryEntry
Leaving only this in the code:
using (var updateManager = new UpdateManager(@"https://signtul.blob.core.windows.net/outlook-addin", "Tulpep.Signtul.OutlookAddIn", FrameworkVersion.Net45))
{
SquirrelAwareApp.HandleEvents(
onAppUninstall: v => RemoveOutlookAddin()
);
await updateManager.UpdateApp();
}
Still two links in the Programs and Features menu, and two folders in %localappdata%. @paulcbetts Any Idea? Maybe if create a public repo with the problem can you check please?
@paulcbetts by my side this issued is closed!
I could replicated multiple times, so would be great if you check this:
With this nuspec file it generates two folders in %localappdata% and two entries in Program and Features.
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Tulpep.Signtul.OutlookAddIn</id>
<version>1.0.658</version>
<title>Signtul Outlook AddIn</title>
<authors>Tulpep</authors>
<projectUrl>http://www.signtul.com/</projectUrl>
<iconUrl>http://www.signtul.com/Content/Img/favicon.ico</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Tulpep Signtul Outlook AddIn</description>
</metadata>
<files>
<file src="..\Tulpep.Signtul.OutlookAddin\bin\Release\**\*.*" target="lib\net45\" />
</files>
</package>
With this one it works good
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>SigntulOutlookAddIn</id>
<version>1.0.658</version>
<authors>Tulpep</authors>
<projectUrl>https://signtul.com/</projectUrl>
<iconUrl>https://signtul.com/Content/Img/favicon.ico</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Tulpep Signtul Outlook AddIn</description>
</metadata>
<files>
<file src="..\Tulpep.Signtul.OutlookAddin\bin\Release\**\*.*" target="lib\net45\" />
</files>
</package>
I don't know if maybe Title or an Id with dots generates this strange behavior, but only removing this two attributes and changing the Id in the UpdateMangaer fixes the issue.
How to update the same package in squirrel again & again without new version. Eg: I want to update the v1.0.1 two times? is there any possibility. No new folder should be created. it should update the existing package in the file location.