ClickOnce/Excel-VSTO under Windows 7 - visual-studio-2010

We have developed a .Net 4.0 VSTO Excel AddIn in VS2010 that we are deploying via ClickOnce. Our deployable seems fine on Windows XP but is extremely problematic when installed on Windows 7. The problems all seem to relate to when the AddIn needs to be removed via Excel (i.e. it has been soft deleted by Excel [eg. due to failure, etc] and it is then 'Remove'd by the user via the Excel | Options | AddIns | Manage | COM AddIns dialog.
The above leads to a situation where an AddIn is re-installed after the above has occurred, it is not exposed within Excel - i.e. the Excel AddIns tab (which would normally appear if there is one or more AddIns installed) vanishes forever. It becomes even more of a problem when we are developing/debugging, as we are renaming/removing AddIn instances on the fly - so much so that developing VSTO on Windows 7 is no longer feasible
Note that the AddIn is not in the hard deleted (disabled) list - it has been removed. I have tried installing/re-installing/uninstalling, rebooting, removing registry items (cleaning up cache/after-uninstall), removing file system files from C:\Documents and Settings\\Local Settings\Apps\2.0, clearing cache (via mage and/or rundll32 as per Clear the .NET-downloaded application cache without Mage?). There seems to be a clear difference of behaviour between XP and Windows 7.
Has anyone had similar problems ?
The only alternative I can see is a deployment project with a fully blown MSI, however this is no where near as neat - requires local Admin access, etc
Many thanks
Travis

Not sure if you have read about the tutorials about publishing Office solution using Clickonce. If you haven't, you can find them via the links below. Worth reading.
http://msdn.microsoft.com/en-us/library/vstudio/bb772100(v=vs.100).aspx
http://msdn.microsoft.com/en-us/library/vstudio/bb608591(v=vs.100).aspx
Regarding using windows installer, it's not extremely hard to do, especially with Visual Studio 2010 setup project. Here's a very detailed tutorial that can guide you through all these. It helped me a lot when I was trying to deploy the Excel add-in, and I hope it'd help you too in some way.
http://msdn.microsoft.com/en-us/library/ff937654.aspx
Also you might want to ask yourself these questions to determine whether or not using Clickonce/Windows installer is the right choice.
When it comes to your choice in deployment technologies, you don't
need to limit yourself to just one option. The key is to choose the
right tool for the right job. While there is no single rule or simple
answer, there are some general guidelines you can use to help make the
best decision for your specific needs.
Does the application install any COM components?
Does the application require registering any components for COM-Interop?
Does the application install any services? Does the application have to
install to a specific location or to the Global Assembly Cache (GAC)?
Does the application have any components that are conditionally
installed, based on the operating system or runtime environment?
Does the application require user input at installation time?
Does the application require configuration of system-level services such as
Active Directory or COM+?
After the application is installed, does it create files, write to the
registry, or affect the system in some way that would leave resources behind when the application is removed?
If you answered yes to any of
these questions, then Windows Installer is the best choice for
your needs. However, if you don't need to address the scenarios
described in the list above, then ClickOnce is an excellent candidate
for your deployment solution. If you want to leverage the distinct
benefits provided by ClickOnce, then understanding the capabilities of
ClickOnce early in your application design process is critical.
Deploying an early version of an application with ClickOnce, but then
belatedly realizing a need to move to Windows Installer, would create
a difficult upgrade path that can be avoided through careful up-front
planning.

From my experience, on one of my production projects we have also used MSI. And problems with click once were avoided. So my answer - yes you need to have MSI Project or MSI installations. And with MSI installations you can either use default MSI Project or external, e.g. Wix or Wise Installer or something else. Second way with custom installer is much more harder.
For situations with removing I've used mage and manual delete add-in from cache and registry. It helps, but looks like hacks.
Also each time when dealing with VSTO ClickOnce unclear, I've thought to use some external libraries. Unfortunately I haven't such opportunity to use something 3rd party to make my work easier due to requirement to project. But you can check and try. May be Add-in-Express libraries will help you, especially when they have good technical support.

What we found was that the way to get ClickOnce working for VSTO on Windows 7 was to do this within Excel - i.e.
Add/Remove Programs : uninstall
Excel | Options | AddIns | COM | Go
Add | browse to the ClickOnce setup.exe | OK | etc
Close down Excel
Go into Excel
AddIn appears
I'm sure you can play with the Add/Remove programs uninstall (versioning) so the user doesn't necessarily have to manually uninstall
ClickOnce is gr8 when it works - it's journey to get there tho and needs to be tightened up big style

Related

MSIX Installer and dependencies

I have a Windows App SDK based desktop application. I am using the single-project MSIX packaging in VS2022. What I need to figure out is how to get the installer to launch 3rd party installers (Nvidia Cuda for instance) as part of the application install. What should be pretty straight forward is lost in the weeds in the sparse documentation on MSIX. I also will eventually want to overlay multiple MSIX installs in one location. I am pretty sure I can't do this directly from Visual Studio but it seems possible using the MSIX Tool. Any pointers would be helpful.
While MSIX doesn't have install custom actions, for some things we can still customize some things at the user system.
Handling this externally from the package deployment is the recommended method. There may be other options, however.
With source code you can modify the app to detect if you need to do something and do it. If "it" needs elevation you need to add the allowelevationcapability in the manifest and there will be a UAC prompt for the user.
With or without source you can instead add the PsfLauncher of the Package support framework to run a script on launch of the app. PsfLauncher will take care of the detection on if run before for you. And the same elevation concerns apply.
As these methods run in the user context they really aren't any good if elevation is needed, hence not the recommended way.
Tim Mangan.
First of all, don't start using the MSIX Packaging Tool. As I said in previous SO threads, that tool is designed for IT pros, not for developers.
Second, as Tim concluded, I wouldn't recommend overcomplicating yourself to deliver those third-party installers via MSIX.
Instead of overcomplicating yourself with integrating the Package Support Framework into your MSIX package, I would think twice if it is worth deploying the application as MSIX. Last time I checked you could still get an identity for your app even if you deployed it with an MSI (I may be wrong here).
If you choose to keep the MSIX for your app, maybe a cleaner solution is to build an EXE wrapper (also called bootstrapper in the packaging world) over it to handle the third-party package installations, and when done with those it can launch your MSIX installation?
Unfortunately, so far Microsoft isn't making it easy for us to define a non-MSIX dependency.

NSIS automatic and silent update

I am currently building an application and want to have an installer and automatic silent updates for it.
Dropbox, Spotify and Chrome all are amazing at updating without anyone noticing. So I took a look at the Dropbox Roaming Folder in AppData and found a file named DropboxUpdateHelper.exe with an NSIS Icon. In the Spotify folder I could only find a SpotifyHelper.exe and a mentioning of NSIS in the Terms.
Is there a tutorial of how to install an application inside the Roaming Folder and have a silent auto updater? I am not fixed on NSIS but would prefer an open source and free installer.
NSIS has the INetC plugin that can be used to download things from the internet but I don't know if there is an auto update tutorial out there. You might also want to take a look at the VPatch plugin...
There are many variables to think about here:
Should your main application look for updates or just run the updater on application (or windows) startup so it can check?
Are the files on the server signed or do you have other ways to detect invalid/corrupted/MitM updates?
Do you require access control/DRM before downloading/applying updates?
How will you handle major version number updates? Will you support more than one major version or force upgrades?
Do you require administrator rights to update? UAC handling?
How are you going to support upgrading from 1.0 to 1.2? Update to 1.1 first or support every possible minor version upgrade path?
I'm sure there are many other issues you also have to think about. You should probably try to answer all these questions before you start coding. During development you might find other questions or that you have to change the design completely.
IMHO, this is not a simple question and I don't think you will be able to find a drop-in solution that fits your exact design/requirements...
It is easy to download files from internet using NSIS (there are several plug-ins for this purpose: NSISdl, InetC, ...) but such functionality is more about coding.
There is no exact solution for this - as Anders said you need to specify every detail to achieve required behaviour.

how to implement copy protection for installing my .net application

I have gone through the several samples in the web.I understood to protect software by giving
Password for each application.I am not asking about abstract concept because I had developed one concept for mine.My question is Where can I implement this codes ?
I read about various options in visual studio such as setup project,clickonce.In setup project I can't add any executables or any script to password protect before installing my application.
I want user to give password during installation so that the installation process proceeds and finished succesfully
How can I achieve this in visual studio ?
To be honest, the only way that I know that you will be able to do this in Visual Studio (your actual question) is to write your own application to be an installer. Even then the password will probably coded into your installer, so will be easy to hack. I would recommend you either look into another technology or addin. Why not copy protect the application and by an off the shelve plug in to do the security? In this area I really wouldn't re-invent the wheel - it's not worth the effort (and therefore cost)

Can no longer locate service packs for Visual Basic 5

I have been using Visual Basic 5 since it was first released until a couple of years ago.
I re-installed it on each new laptop I bought and downloaded the service pack each time. I think it is SP2 for VB5 I need.
But having not touched it in two years I have now just installed it on a laptop to modify an app. However, it seems that Microsoft no longer offers the service pack for download.
And on opening my projects i get repeated messages for each frame telling me I "don't have the license to use the control in developer mode".
What is this error and how do I get the service packs?
If you port to VB6, you shouldn't have to make very many changes.
If you port to any version of VB.Net, you will find that the changes are rather extreme. An automated tool will try to do some of the work for you, but depending on how your code was written and what VB5 features you used, you will probably find that you manually need to fix up most of the changes that were made.
The biggest problem is that some of the VB5 features don't have direct equivalents in VB.Net. Do any of your forms use control arrays? You CAN do something at least vaguely similar in VB.Net, but the conversion tool doesn't know about that, so converting them will have to be completely manual.
FYI, Microsoft service packs are available in two forms. The normal update process figures out what patches are needed on your computer, then downloads them and installs them. But there's also an "administrative" version that downloads every change that MIGHT be needed, in one package. That package doesn't automatically install - when the download is complete, you have to manually start it running. The admin version is intended for system administrators, who might have to apply the same patch to dozens / hundreds / thousands of computers on a network - you shouldn't have to download the same data over and over.
The admin service packs won't help you with VB5, of course (unless you find someone that downloaded the VB5 service packs and held on to them). But if you end up going to a new version of Visual Studio (or VB), and you think that it's likely that you'll keep using them more than 6 months or so past the end of Microsoft support, you might want to get in the habit of downloading the admin service packs and archiving them somewhere. It might prevent problems like this in the future.
The licensing issue is referenced on Microsoft knowledge base
http://support.microsoft.com/kb/181854
A fix is available, downloadable from the same place.
Note : if you are running Windows Seven, you need to run VisualBasic in elevated mode.

Using a WinForm as a Windows Installer Custom Action

I am working on in installer project that needs to gather some info and act on it during the install (mainly online key retreival and registration). The Setup Project UserInterface templates seem inflexible and poorly documented so I am looking at opening a WinForm as a Custom Action.
I know this is possible because I see reference to it in many places but this is my first Windows Installer experience and so far it is mired in googled contradictions, partial or outdated information and guesswork... erg....
Does anyone have (even a pointer to) a clear concise description of how one gets this done in a VS 2008 WinForm project...
Many thanks for inputs
There is no guarantee that the .net framework is installed when the installer is launched (especially on Windows XP). A best practice is to keep your installer away from any dependencies.
Put the online key retrieval and registration in your application rather than doing all that stuff during install.
Create a standard installer class. In the class create your form and show it (ShowDialog is prefered)

Resources