Setup & Deployment Project creates extra Add/Remove Programs Icons - setup-project

I'm having a weird problem...
I created a basic WinForms app in C# using Visual Studio 2013, and I added a Setup & Deployment project to the solution to build my .msi installer. For the Setup & Deployment Project's properties, I have the DetectNewerInstalledVersion to true, and the RemovePreviousVersions set to true. Then, with every build, I'll increment the version number and let Visual Studio change the ProductCode. Lastly, I'll make sure that the UpgradeCode stays the same.
In this configuration, if users run the .msi with a previous version installed, then it performs an upgrade. Everything works (as in all files are updated to the new versions, etc.). But, when they open Add/Remove Programs, the icon for the old version(s) is still there, as well as the icon for the new version.
For example, if they used the .msi to install MyApp version 1.1, then used the .msi to upgrade to 1.2, then again to 1.3, then MyApp will correctly update to version 1.3, but the user goes to uninstall it in Control Panel->Programs and Features->Uninstall a program, there will be three MyApp icons (one for each version). And to properly uninstall MyApp, they must right-click/uninstall all three. If I delete the old versions from the registry (the usual fix for stale icons), then MyApp will not uninstall correctly. The uninstall will go through the motions without error, but the program files and icons will remain, and the application will still function like normal. To troubleshoot, I've made a series of builds with sequential version numbers, then opened each build's .vdproj file in a text editor to ensure that the ProductCode and PackageCode have been updated, but the UpgradeCode remains the same. They do, so it's not a problem of the UpgradeCode changing. I've also tried deleting the registry keys for the old icons. This gets them out of the Programs and Features uninstall list, but it prevents the program from being properly uninstalled this way, so this isn't an option.
Anybody have any ideas?

This will happen when the first install is (say) Everyone and the upgrade is installed Just me (or vice versa). One type will not upgrade the other, so files will be replaced if installed to the same location, but there will be an entry for each in Programs&Features. They all must be Everyone or Just me to replace previous products.
You can install the upgrade with msiexec /I [path to msi file] /l*v [path to a log file] to see what's going on. If you search for occurrences of FindRelatedProducts you should see something about what it found and if it was the right context.
Note that Visual Studio setups can change the context if you do not have administrator privileges. You might specify an Everyone install but Visual Studio will change that to Just me if you don't have the privileges.

Ok. Weird...
The issue comes from the way that it's run. Once installed, the program checks the network share for a newer .msi, and if it detects one, it downloads it, then launches it with Process.Start and command-line args. The StartInfo.Arguments string looked like:
startInfo.Arguments = "/i \"[MSIPATH]\" /log \"[LOGPATH]\" TARGETDIR=\"[APPPATH]\" /qr+";
I guess someone fat-fingered the UI mode switch at the end. The "/qr+" switch should be "/qb!-". When I changed it, the problem stopped. I don't think that "/qr+" is even a valid switch, so I'm not sure why the install didn't just fail outright??? Anyway, that was the problem should anyone see something similar.
Special thanks to PhilDW for pointing me to the logs. :-)

Related

Symfony self-update failing

When I do symfony self-update I get the following error - how can I solve it?
Backup failed, rename D:\SERVER\Symfony\symfony.exe C:\Users\FairyWilbury\.symfo
ny\autoupdate\2019-07-19_14-57-14-79024bb-old: The system cannot move the file t
o a different disk drive.. Canceling upgrade.
UPD.
I have just realized that the latest symfony version seems to be 4.3 with 4.4 due to release in November https://symfony.com/roadmap/4.4
Yet whenever I run symfony new --full %projectName% it suggests I should update to 4.6 (and then fails to update as described above). Screenshot of the command line: What can this problem be?
First of all, you're mixing up Symfony Local Web Server and the Symfony PHP framework. You can use the web server, which is a single executable command line developer tool, to start a new Symfony-based project or start a local server that makes your web application available for testing and debugging while you develop it. The framework, on the other hand, is the code base you build web application on.
When you run
symfony self-update
from the command line, you (try to) update the web server, not the framework.
The latest version of the web server, at the time of writing, is 4.12.10, while the framework is at 5.0.5 (or 4.4.5), so, as you can see, they're completely independent from each other.
Back to the original problem, and I was struggling with this as well, the catch is that we both use Windows and installed the web server (symfony.exe) to a folder in drive D: (in your case it's D:\SERVER\Symfony). While it's running, it stores config and other files in a ".symfony" directory in the folder of your Windows user account (C:\Users\FairyWilbury). And during the self-update process, that's where it tries to move the original symfony.exe file. For some unknown reason, it cannot do that between different drives, not even in an Administrator-privileged command line window.
Strange, as it is, the only solution I found was the following.
I created a TEMP folder on drive C:
Copied symfony.exe from its folder on drive D: to C:\TEMP
Opened up command line, and switched the current dir to C:\TEMP
Ran symfony self-update -- this time it went smoothly
Closed the command line window
Moved the new symfony.exe file from C:\TEMP to the folder on drive D:
Removed C:\TEMP folder
I know it's a bit cumbersome, but we have to consider that Windows is not the most popular development platform for PHP applications. ;)
okay, look, in this case, I dont really find anything about this symfony self-update stuff, so...
In the version title the third part (so the 1 in 4.6.1) is a patch, what that only contains bug fixes, so you need the latest minor version first 4.6.0.
Basicly you need follow this doc:
symfony/doc/upgrade_patch.html
And, as it starts above, first you need follow this doc (attentively):
symfony/doc/4.2/upgrade_minor.html
This upgrade_minor.html writes: The composer.json file is configured to allow Symfony packages to be upgraded to patch versions., so ...
This command helped me to update symfony binary:
sudo symfony self-update

Building an installer project in VS2017 causes "Configuring VS2013" message"

Just recently uninstalled VS2017 RC and installed VS2017 RTM.
We have a Windows Service solution which includes a Setup project.
When I build this in Visual Studio 2017, somehow it's triggering something in the installer for Visual Studio 2013 (which we're still using), as I get this popup appearing:
It's fairly reproducible, but I have no idea where to start with this one.
Any ideas how to stop it happening?
It didn't happen before with the release candidate.
EDIT:
So, several VS2017 updates later, this problem had got a lot worse, as it was stopping me building the setup project completely. Previously I was able to click cancel as in my first screenshot, but at VS2017 v15.3.3, it wouldn't cancel, and if I let it run, it hung at:
So this forced my hand somewhat. I've accepted #PhilDW's answer as he led me straight to the main clue, but I'll also add an answer of my own with more detail.
As in PhilDW's answer, I checked the event log, and found this:
Detection of product '{9C593464-7F2F-37B3-89F8-7E894E3B09EA}', feature
'Visual_Studio_Professional_x86_enu', component
'{E3FF99AA-78B9-4A06-8A74-869E9F65E1FE}' failed. The resource
'C:\Windows\Microsoft.NET\Framework\URTInstallPath_GAC\' does not
exist.
A little Googling, and I found this MSDN blog entry:
Workaround
We are consistently seeing this issue caused by a missing directory,
C:\Windows\Microsoft.NET\Framework\URTInstall_GAC (or
%SystemRoot%\Microsoft.NET\Framework\URTInstall_GAC).
To work around this issue,
Open an elevated command prompt.
Type: mkdir %SystemRoot%\Microsoft.NET\Framework\URTInstall_GAC
Note that the folder name isn't the same as in my case. I didn't notice this initially, and creating the folder didn't cure the problem.
However when I created the actuall folder referenced by the event log message, the problem went away, and I can now build my setup project without messages about VS2013.
It's a repair of Visual Studio 2013 because Windows thinks the install is broken (registry entries or files not as in the original VS 2013 install). If you look in the Windows Event log, Application, there should be some MsiInstaller log entries that tell you the product (by ProductCode guid) and the broken component (by component guid and file or registry name). This might help identify what's going on, but not necessarily have a clue to a fix. If it's a setup project it might be a conflict with mergemodule Dlls or prerequisites, some of which come from the current SDK.
You don't say if you're letting the repair complete, in the case that it's just an isolated occurrence.

Qt Installer framework, uninstalling / updating offline

I'm trying to make an installer using the Qt Installer framework and when an upgrade is available in the software (checked through our rest API), our software will download the new installer and run it.
This should of course uninstall the previous version first, however, it seems just running it will give you "The folder you selected already exists..." error.
I thought using the maintenance tool that is generated would provide a solution, however, it seems that there is no way to run this with a switch to just do the uninstall. It shows up with the dialogue of uninstall, upgrade... which would confuse the users.
Is there a way to get the maintenance tool or otherwise to uninstall the program, so the update can be run?
EDIT:
If this cannot be done, can anyone suggest a good cross platform installer framework?
Do not try to run the installer again, run the maintenancetool.exe to update. You can make a "silent" update by passing a script to the maintenance tool like this:
#echo off
maintenancetool.exe --checkupdates > checkUpdate.txt
findstr /c:"updates" checkUpdate.txt
if %errorlevel% == 0 maintenancetool.exe --script=script.qs
http://doc.qt.io/qtinstallerframework/noninteractive.html

JWrapper windows shortcuts broken

JWrapper support now redirects to StackOverflow, so I'm posting here.
The Windows shortcuts created by JWrapper don't work; they point to a location which doesn't exist; I can verify this by navigating to the directory pointed to in the properties of the shortcut:
C:\Users\jchrist\AppData\Roaming\JWrapper-SampleApp
and seeing that the expected SampleAppWinLauncher.exe isn't there.
I can reproduce this simply with a slight modification of the SampleApp. Open the jwrapper-sampleapp.xml file and copy main virtual app, but give it a different name:
<App>
<Name>SampleApp2</Name>
<LogoPNG>sampleapp/logo.png</LogoPNG>
<MainClass>jwrapper.SampleApp</MainClass>
<Param>one</Param>
<Param>two</Param>
</App>
If you do this, and then run the 32-bit offline installer, you'll get a dialog which allows you to select which of the two virtual apps you want to launch.
After selecting one of the (identical) virtual apps and quiting it, the shortcuts provided in the start menu in the SampleApp folder do not work. If you dig into the properties of the shortcuts, you can see they point to an executable which doesn't exist. (It did exist, but it deletes itself after the first run).
I'm using the latest JWrapper (jwrapper-00036138363.jar, although this problem existed with jwrapper-00035090611.jar) as well.
I've tested this on Windows 7 today and it works OK. I haven't tested this on server 2008 but Windows 7 is treated basically the same as Server 2008 by JWrapper. Also the executable disappearing after the first run is not normal behaviour.
My guess would be that this is antivirus software that is detecting the run as a false positive and deleting the executable. Do you have any AV software installed? can you turn it off to test?
Unfortunately some AV software will delete files etc without any warning.

Problem running Java application

I have developed a Java swing application, then I have deployed it through a .jar package.
I run my application on my PC double-clicking over the .jar file and everything goes fine, everything goes fine from command line (dos prompt) too.
Here my problem.
I have tried to run my app on another PC:
same OS (Windows XP)
same JRE (1.6.0_U13)
but Oracle JInitiator 1.3.1.18 installed (this is the only difference with my PC)
The app works fine only from command line, but not from gui!
Double-clicking over the .jar file I get this error:
`Could not find the main class. program will exit!`
Can this error be due to some conflict between JRE and JInitiator?
Does anybody had the same trouble?
Thanks
edit:
executing .jar files from gui is associated to the "javaw" command
It is probably a conflict with JInit, which changes the association between jar files and the java command used to launch them.
See this thread.
Re-installed java and the problem has gone away.
A quick description might be - jinitiator installs as a fully implemented JRE with some additional features for cached downloads when dealing with applets.
As all the JRE installers I've seen lately do, regardless of if they are new or old, they replace several entries in the registry to become the active JRE. Whatever you installed last will be run unless you provide a full path to java.exe or change the registry to re point at a different JRE.
examine:
HKEY_CLASSES_ROOT\jarfile\shell\open\command
and see if the path to javaw.exe is correct. (or even included)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App
Paths\java.exe and javaw.exe and javaws.exe to check the path there also.
Have you checked your PATH/CLASSPATH/JAVA_PATH variables. It is possible that Jinitiator has installed the wrong version at the front.
Possibly check your manifest entries. See if the MANIFEST.MF in the jar contains the Main-Class attribute set correctly to the class that is supposed to be invoked, if not try setting it.

Resources