VS2017 Installer Project - Cannot Make Uninstaller - visual-studio-2017

I have been able to successfully install a simple program using an Installer Project on Visual Studio Community 2017. However, I can't find out how to create a fully working deployable uninstaller for an end user.
The Installer Project was set up to only create an Application Folder (in C:\Program Files...) with the Program .exe, and nothing else. This it does successfully. I would like an installer because later I plan to make some registry keys upon installation.
To test uninstallation, I have run the original .exe file built by the Installer Project with the "Uninstall" option. This removes the Application Folder but does not remove the program from the Add/remove programs list in Windows - Leading me to believe there are other registry entries that have not been removed.
I have tried to uninstall purely from the Add/remove programs list, but then I get an error:
C:\WINDOWS\system32\msiexec.exe
"Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item."
In Visual Studio, I can click "Uninstall" from the Installer Project right-click menu which does successfully remove both the Application Folder and the Add/Remove Programs Item, but this is not a deployable solution.
Notes:
OS: Windows 10
Using Visual Studio 2017 Community
Looking at the application Folder, there is neither an install nor uninstall .exe file in it. The Installer Project .exe is only in the original build location, and I cannot find how to get a copy in the Application Folder (not sure if a copy there would work).
I have tried configuring the Installer Project as x86 and x64 with no change.
I have tried using both Debug and Release build configurations with no change.
From looking around, WiX seems to have more features and flexibility, but I haven't yet dug into that. Is there an easier solution?
Has this issue occurred to anyone else? My hopes were that Installer Projects were the simple way to learn and handle installation.

Looks like I jumped to conclusions in the comment above, however I think I found the issue: I cannot uninstall the program from the Windows Apps & Features window in System Settings, but uninstalling from Control Panel\Programs\Programs and Features works fine.
When typing in "Remove" using the windows start button, the default item that comes up is "Add or Remove Programs" in System settings (This looks like a Windows 10 thing). When you click that, it forwards you to the "Apps & features window. I am now learning that for some reason this has different functionality than the control panel window. Or maybe it has lower permissions, although I am the admin and only user of this computer...
Because it can be uninstalled from Control Panel, I think this would be the preferred solution. My assumptions about the other window in system settings was my real issue. I just wish the Apps & features window aligned its functionality/permissions with control panel.
I also learned that uninstall is successful when I run msiexec.ex /I{PACKAGEID} in cmd. Not sure how relevant this is, but documenting here.

Installs and uninstalls are transactional, they either work completely or roll back completely. If you do an uninstall but the entry remains in Add/Remove Programs then it's likely that the uninstall did not in fact work.
When you do the install, if it has a UAC elevation dialog then the install is running with elevation and installing files/registry entries to locations prohibited to limited users. Removing files from those locations also requires elevation. You haven't said exactly how your uninstall works, but most likely it requires elevation to succeed, and your program isn't running elevated. If your program uninstalls silently the uninstall will fail silently, so it's possible that your program isn't actually checking that the uninstall worked.
I'd also guess that your Visual Studio session may be running elevated so uninstall from there works fine.
Apart from privileges, an uninstall from a running installed program tends not to work very well because the uninstall process cannot remove your running program or its folder because it's in use. So while you could get it to work (with elevation) you might find that your program and its folder are left behind until the next reboot. If people really want to do this, one of the strategies is to copy an uninstall program to the temp folder and fire it off asynchronously, so everything can be removed.
Uninstalls from Add/Remove Programs&Features generally work fine. Without some context that error message doesn't mean much. It's not a message that comes out of Windows Installer, so it's perhaps coming out of a custom action. Otherwise it may be an issue specific to the test machine.
There is never an uninstall exe in a Windows Installer setup. When you remove a product the system just calls the Windows API to remove the product. Windows Installer is part of the Windows OS with API support for everything that needs doing. Only non-MSI setups require an install and uninstall exe to do anything.
None of these issues seem to be related to your choice of tool. They all create MSI files and if an MSI design is not optimal it doesn't matter what tool you use. There's nothing wrong with WiX, but to install literally a few files it's overkill compared to Visual Studio.

Related

Outlook: VSTO does not show its initial window

I had developed a VSTO module to Outlook using VB.NET and VS2017-Community.
At the first installation, it asked for an user authorization to install, showing the Product name and the Vendor/Manufacturer data, based on the ClickOnce compilation (I guess).
Everything rans ok...
But now I uninstalled completely this AddIn and, when I call the SETUP again (due to a newer version), the Outlook does not show this window anymore - the Ribbon is updated automatically, my custom ribbon appears, etc.
In other words: my new version is installed into Outlook seemless and runs perfectly; except for the fact of the VSTO window does not appear anymore during the Outlook load (which would be like I saw before at the 1.0.0 version of my software).
I would like to see a CLEAN installation, I mean, exactly what a user which had never installed my software would see.
Some data to enlight the problem:
1- I'm using MSI installation and uninstall. Everything runs 100%.
2- The uninstall clears all the registry keys and the application folder.
3- I saw %User%/AppData/Local/Apps/2.0 folder and, also, there are no references to my project.
4- I open REGEDIT and check the following keys. All of them are cleared (no references to my AddIn):
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Outlook\Resiliency\AddinList
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Outlook\Addins\
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DisabledItems
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\CrashingAddinList
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DoNotDisableAddinList
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\NotificationReminderAddinData
(there are no Local_Machine key created here, my Office is 32-bit not running as Admin/Local_Machine).
So, how can I make a clean installation like I saw before?
I appreciate any help.
I found the solution!
We must clean the references also in:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\AddInLoadTimes
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSTO\SolutionMetadata
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSTO\Security\Inclusion (keys and subkeys)
That's it! :)

MSI Build uninstall- Installed directory not removing

I created the MSI build package for our application. After this installation, we triggered another dependent driver software in the separate process in a committed event of Installer class like below,
Process.Start (" Path of driver software ")
We are facing an issue, installed directory ( It's empty ) folder is not removing while un-installing the same. Actually like installation, we triggered the un-installation of dependent driver software in the separate process by overriding the Uninstall method of installer class.
Anyone, please help me to overcome this issue? How could I remove the installed directory?
I can't change the installation procedure, since we are aware that we can't process another installation/un-installation when another one is going.
You are running a non-MSI driver install EXE from within your MSI? Correct? Or maybe it is an MSI wrapped in an EXE?
Do you have Installshield Premier? Could you use a suite project and install the EXE via the bootstrapper before (or after) the MSI install? I have honestly never used this feature, but running setups in sequence is what it is for. Embedded custom actions in MSI files kicking off EXE files are notoriously unreliable. This is - in my opinion - especially true if you are running with managed code as well (which I think you are).
In the long run managed code may yield safer custom action code (security-wise based on CAS), but for now it seems to cause unwanted runtime dependencies - especially for very large-scale distribution (global distribution) targeting diverse Windows versions (Vista, 7, 8, 10).
I am told it takes a while to get used to Installshield's suite feature, but maybe it is better for you? You can run EXE files, MSI files, patches and zips in sequence. Some fiddling to define uninstall and upgrade behavior I guess and lots of testing. I am pretty sure corporate application packagers would be happy to see a suite rather than an MSI with lots of strange stuff embedded in it.
UPDATE: Once you have compiled a suite setup.exe file it can be extracted as described here: Regarding silent installation using Setup.exe generated using Installshield 2013 (.issuite) project file
Alternatively you could try to extract the setup.exe files for the driver setup and install the drivers as regular MSI components and run DPinst.exe to install / uninstall the drivers (tool from DIFx). Also quite clunky - especially when you need to include uninstall.
Your driver setup likely uses DPInst.exe already. I would check if you can extract an MSI from the EXE and use it instead of the EXE to include in the suite project. Some hints for how to deal with setup.exe files (extraction, runtime paramenters etc...): Extract MSI from EXE.
WiX has the Driver element in one of its extensions to deal with driver installs. I have never had the chance to test it.

Could not locate deviceQuery on my installation Cuda toolkit v7.5 on Windows 10

As I was going through installing Cuda v7.5 following this link http://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/#compiling-examples
I was not able to verify the installation as described in section 2.5. Verify the Installation. The reason was because I could not find deviceQuery program that should have been located in
C:\ProgramData\NVIDIA Corporation\CUDA Samples\v7.5\bin\win64\Release
Therefore, I could not run the deviceQuery for Cuda to be verified. Where is deviceQuery program located ? Is it still precompiled and deployed by the installation ?
Okay, so if you are a complete noob like me in using Visual Studio then you might be thrown off by the instruction "build the application first". Just watch this video to get an idea of how to build and run a project/program using VS.
https://www.youtube.com/watch?v=cL05xtTocmY
As soon as you open VS (I am using 15.6), you will be prompted to upgrade the SDK. Make sure to do so. If you've misclicked or skipped upgrading, you can go to the Project pull down menu and click "Retarget Solution" and click ok on the menu that appears. Then build and debug as shown in the video.
Creating the deviceQuery.exe file:
Go to the (default) directory C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\1_Utilities\deviceQuery. Just follow the procedure of running the MatMul file but this time build the deviceQuery_vs2017.sln file and debug it. Remember to retarget the solution.
No, it's not precompiled any more.
You have to compile (build) the application first, before you can run it.
That is true for all the CUDA samples now.
OK, I've had this problem with CUDA Toolkit 10 under Windows 10. In my case, I do never use the admin account, and the installation was done from the user account, entering the admin password when necessary. After repeated trials, here's what worked for me:
Make sure to uninstall any old version of CUDA and Visual Studio
(just to have a clean start)
Restart the computer
Install Microsoft Visual Studio Community Edition. During the
install, make sure to select the C++ Development tools
Restart
Install the Cuda Toolkit
Restart
With this, I had all the files. But the deviceQuery still would not compile because it was targeted to an older version of Windows. To compile it, one needs to 'Retarget' the project to the current windows SDK. However, this doesn't work out-of-the-box because the 'deviceQuery_vs2017.vcxproj' file is read-only for regular users.
So, there are two possible solutions:
Copy the folder to some place where you have write permission, or
(This is what I used, for convenience) Using Windows Explorer, navigate to the C:\ProgramData\NVIDIA Corporation directory. Right click on the 'CUDA Samples' directory, select 'Properties'. Under the 'Security' tab, click 'Edit' and add your user to it.
This way you can Retarget the solution in place. After that, I could open the solution in MS Visual Studio, Retarget it, build it and test it, and all worked fine.
Hope that helps.

Removing Files When Uninstalling via InstallShield Limited

I created an installer using InstallSheild Limited. During the install process, I have a Custom Action which runs a C++ exe after registering the product. In the C++ exe, I move files that are in the installers program directory to various places on the computer.
Now, I need to make the uninstaller be able to remove those files. Is there a way to do this in InstallSheild Limited Edition. If not, what can I do to achieve the same results?

Microsoft Visual C++ 2010 Express installation/run problems

I am running windows 7 and I am trying to get this IDE to work and I am have an incredibly frustrating time making it work.
I am following these instructions
Quick guide:
File > New > Project
Select "Win32 Console Application"
Enter a name and location, select OK
In the Win32 Application Wizard under "Application Settings", select "Console Application" and select "Empty project".
Click Finish.
On the right (or left) hand pane should be Solution Explorer. Open it and right click on the "Source Files" folder and Add > Add New Item.
Select C++ file (.cpp)
Write code, hit F5 to start with debugging, ctrl+f5 to start without debugging.
After step 4 I get the error, "The platform root directory "E:..........\MSBuild\Microsoft.cpp\v4.0\Platforms" does not exist.
What do I do? I installed it in my E drive, maybe what it wants is on my C drive? It is not possible for me to install it there though because I am using a SSD for my C drive.
Update, I have tried to uninstall and reinstall and then clear my temp folder and then reinstall and then uninstall with the uninstall utility and then reboot and the reinstall and none of that works.
I turning off my firewall and antivirus and installing and running and that did not help at all. Next I am going to format my hard drives and try and install again.
I tried installing the ultimate version and I had the same problem. I have no idea what to do, it seems like I am out of options.
Any ideas?
My best guess now is that I have to manually install the missing files somehow, where can I find those?
I installed Dev C++ and it works fine, should I just continue using this (as far as I can tell superior program) or try and fix Express?
Microsoft Visual C++ 2010 Express
The platforms root directory "E:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms" does not exist.
OK
--------------------------- The microsoft.cpp part is missing but it exists in the C drive. I copied that over to the E drive and now when I open a project I get a blank screen, if I open older ones it says I need .net framework 4.0 which I do have.
This has to be the worst program I have ever had to deal with, I have played video games in beta that worked better than that.
I think I got this working, I am not sure though.
It appears to be working but I get some strange errors, I am just going to accept this because at least now after an entire weekend I can begin my homework.
Since - as you've pointed out - you've already reinstalled VC++ and nothing seems to work and you've tried everything - you may also try this (if you've not given up yet):
you may try trial version of full visual studio VS2010 trial
you may try to install your VS express on friends PC on 'non-C' drive
perform antivirus check of your system
after installing full version - install service pack (VS SP)
ensure you uninstall all (if any) prior versions of VC, VB, VC# or visual studion that you may have
always reboot after installation
If (1) works this may suggest your VS express is somehow corrupted (would be weird to be able install it than - but I've seen so many weird things that I may believe it ;-)
If (2) works this may suggest your PC/OS is causing problems.
Let me/us know if any of above helps.
I would uninstall and reinstall the whole thing rather than keep spinning your wheels. Honest!
Q: Your "E:" drive is a read-write drive, isn't it?
Q: E: is the drive you installed to, correct?
Q: Hopefully, E: is a normal disk drive, isn't it?
If not (if it's a shared network drive, or a nice'n'slow USB drive), please consider installing VS2010 to a hard drive.
MSVS should not be hard to install or use. It takes awhile ... but it's usually pretty straightforward.
If you've having problems, then I strongly urge you to 1) uninstall, 2) reboot, 3) reinstall.
IMHO...
http://social.msdn.microsoft.com/Forums/vstudio/en-US/69925677-8a07-46a4-8b0e-c9ddef17a7af/visual-studio-2010-fails-in-c-trying-to-set-the-references-parameter?forum=vssetup
The solution in a similar case of installing VS2010 C# on a seperate drive was to copy the Reference Assemblies folder from C:\Program Files to E:\Program Files.
When I had the the same error as the poster above on VS2010 C++, when installing to a different drive, I did the same for the MSBuild Directory and the errors in VS2010 C++ disappeared.
It seems that Visual Studio installs/creates those directories on the same drive as windows 100% of the time, but the registry values still look for them on the same drive that you installed Visual Studio on.