WIX: Can't stop windows service during upgrade - winapi

I have two program versions:
V0.0.1 - I work on Visual Studio 2005 and wix v3.5 to create a MSI installer.
V0.0.2 - I work on Visual Studio 2013 and wix v3.9 to create a MSI installer.
In both versions I suppose to install a Windows services. The problem is that when I install V0.0.2 on top of V0.0.1 the V0.0.1's service doesn't stop and the installation ends with error. I'm pretty sure that the stop message is not sent at all from the V0.0.2's msiexec through controlservice(as far as I managed to debug it using Windbg).
Install V0.0.1 over V0.0.1 works fine and the stop message was sent successfully.
This is the code of ServiceControl from InstallationFiles.wxi. identical to both versions. Written with help of this site http://wixtoolset.org/documentation/manual/v3/xsd/wix/servicecontrol.html
<ServiceControl Id="MyService.exe.Control" Name="MyService" Remove="uninstall" Stop="both" Start="install" Wait="yes">
<ServiceArgument>InstallerStart</ServiceArgument>
</ServiceControl>
CustomAction is irrelevant in this case

Please be aware that the remove / stop / start on install | uninstall | both refers to installation state of the component not the product. I can't see what component / feature these elements are tied to but if those components aren't getting installed as part of the upgrade then the stop won't occur.

Related

VS2019 MSI Installer error 2727 after migration from packages.config to PackageReference

I have a console application running on .NET Framework 4.7.1 in Visual Studio 2019 with a Microsoft Visual Studio Installer Project (MSI Installer).
After migrating from packages.config to PackageReference, the .msi installer returns the following error once it collects all installer inputs and begins the install.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2727.
.msi installer created before the migration works fine. The executable and project work fine after the migration. The problem is only with the installer. The problem can be reproduced when installing from the VS 2019 project and from the generated .msi file.
There is an error in the Windows Event Viewer and the installer log:
Event Viewer on remote machine
Product: XXXXX -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2727. The arguments are: _0024F16DE39F4B7D9BF184AC802A7310, ,
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="MsiInstaller" />
<EventID Qualifiers="0">10005</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2021-10-21T19:14:41.779642800Z" />
<EventRecordID>18270804</EventRecordID>
<Channel>Application</Channel>
<Computer>XXXXXX.com</Computer>
<Security UserID="S-1-5-21-3296303954-3414968290-1573956784-1136" />
</System>
- <EventData>
<Data>Product: XXXXXX -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2727. The arguments are: _0024F16DE39F4B7D9BF184AC802A7310, ,</Data>
<Data>(NULL)</Data>
<Data>(NULL)</Data>
<Data>(NULL)</Data>
<Data>(NULL)</Data>
<Data>(NULL)</Data>
<Data />
<Binary>7B41433031463831372D434435302D343530332D423239342D3844334438453538323844417D</Binary>
</EventData>
</Event>
MSI Installer Log on local machine
MSI (c) (4C:5C) [16:58:07:070]: PROPERTY CHANGE: Adding INSTALLLEVEL property. Its value is '1'.
MSI (c) (4C:5C) [16:58:07:070]: Note: 1: 2727 2: _7F06229DCDB74690AC0D18DBD0357B3B
DEBUG: Error 2727: The directory entry '_7F06229DCDB74690AC0D18DBD0357B3B' does not exist in the Directory table
DEBUG: Error 2835: The control ErrorIcon was not found on dialog ErrorDialog
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2835. The arguments are: ErrorIcon, ErrorDialog,
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2727. The arguments are: _7F06229DCDB74690AC0D18DBD0357B3B, ,
MSI (c) (4C:5C) [16:58:08:457]: Product: XXXXX -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2727. The arguments are: _7F06229DCDB74690AC0D18DBD0357B3B, ,
Nothing else in the log has the value _7F06229DCDB74690AC0D18DBD0357B3B. This value is the same between installs. This is not the ProductCode or the UpgradeCode in the installer properties.
Setup
Visual Studio 2019 Enterprise
Windows console project (runs as a service)
.NET Framework 4.7.1
Microsoft Visual Studio Installer Project 1.0.0 extension
Installer runs on Windows 10 Pro and Windows Server 2016
What I tried:
Clean and rebuild everything
Manually create all directories the installer is supposed to create
Removed unused dependencies (dlls) from the installer - they were highlighted in red.
Added <SatelliteResourceLanguages>en</SatelliteResourceLanguages> to *.csproj file as suggested by another SO answer
All code is backed up so I can go back to package.config but would prefer not to do so unless no solution could be found.
Note: for whatever reason, the .msi after the migration is almost twice as large as the .msi before migration.
Update
The installer fails right before the Select Installation Folder dialog (which is not shown when the failure occurs).
This is the screen before which the installer fails.
I also tried to revert the branch to before the migration but the revert is not working as the migration changes remain and prevent the installer from working. I had to delete all files and restore them from Git to finally remove the migrated packages and get the installer working.
The solution ended up being to delete the old installer project, migrate to PackageReference, and create a new installer project.
Based on Git, the only differences ended up being the references in the .vdproj file. The new installer was larger than the first but everything else was the same.
Problem
Installer stops working after After migrating from packages.config to PackageReference.
Solution
Delete the installer project (make sure you have a backup).
Do the migration.
Create a new installer project.
Cause
Auto-migration does not update the .dll references in the Installer project.
#eglease did most of the work here as I also would say this happened right after a ProjectReferences conversion.
But I found that I could clear the output and re-add it rather than deleting the whole project that I was also able to clear the error.
Delete these (or maybe just the primary output)
Re-add them:
That cleared the error for me.

Installation : Microsoft Visual C++ Redistributable stuck at 'Processing: Windows7_MSU_X64'

I'm trying to install the package of Microsoft Visual C++ Redistributable as my xampp apache module cannot be installed. The installation take a very long time to complete. What should I do? Is this common and is all I have to do is wait?
They are dead stuck with this setup progress as the indication
Processing: Windows7_MSU_X64
To install the Visual C++ 2015 Redistributable, you do not need to remove or uninstall the previous versions.
Refer to the error message, you can have a look at the installation log file and search ‘error’, if you can find the error message about Windows6.1-KB2999226-x64.msu, check this similar issue and have a try with the following to troubleshot this issue:
Download the update KB2999226 for your OS edition from here: Update for Universal C Runtime in Windows and before it, since your OS is windows 7, make sure SP1 is installed.
Manually install the KB2999226 as below:
Find the Windows6.1-KB2999226-x64.msu from the folder C:\ProgramData\Package Cache\xxxxx\packages\Patch\x64, which you can the path from the installation log
Create a folder named ‘XXXX’ in that and execute following commands from Admin command prompt
wusa.exe Windows6.1-KB2999226-x64.msu /extract:XXXX
DISM.exe /Online /Add-Package /PackagePath:XXXX\Windows6.1-KB2999226-x64.cab
vc_redist.x64.exe /repair
If you have no idea about the installation log, you can go to %temp% and order by ‘Date modified’, then you should find the installation log, or you can use http://aka.ms/vscollect to gather the installation logs. After using it, you will find vslogs.zip under %temp% folder then upload the file to https://onedrive.live.com/ and share the link here.
I first tried a clean boot and that didn't work so I opened up the task manager to see what other processes I might kill while it was stuck at "Processing: Windows7_MSU_X64" I killed the process titled "windows update standalone installer" and the install completed successfully the moment I killed that process.
Okay, I found the solution for my stucked installation. I updated my Windows manually using wsusoffline tools as my Windows can't seem to update with the usual ways.
Install wsusoffline and select all update for Windows (Windows 7 for me). Make sure to choose the folder to save your update.
Wait for the update to be downloaded
Install the update
Install the MV C++ Redistributable again
Done!
I finally can install my Xampp Apache module and access to the localhost.

Windows 10 SDK won't install to Visual Studio

I've been trying to get Visual Studio and the Windows 10 SDK to work for over a week now. First I couldn't install Visual Studio. That problem was resolved by uninstalling EVERYTHING vaguely related to VS2015, thanks to manually going through everything, but also the Visual Studio "TotalUninstaller".
Plot twist: Now that I've managed to get VS2015 installed and running, I can't get the SDK to install. I've selected it with the installation process, tried to modify VS after, tried to install it with the Standalone installer, but none of it works. Every time, the installer doesn't notice anything wrong, all the tools appear in the start menu, a new "Program Files (x86)/WindowsKits/10.0" folder appears, with all the correct files, but VS can't open any UWP projects, can't create new any, and the SDK doesn't appear in the Extensions list.
When I uninstalled everything, there was only one thing I couldn't get rid of: "Windows 10 for Mobile Image - 10.0.10240.0". It just opens, runs for a second, and closes, achieving nothing in the process. As I couldn't get rid of this, I manually deleted any "Windows Kits" related folder in Program Files, Program Files (x86), ProgramData, and anything in the AppData folder. But this piece of fluffy garbage didn't leave my installed programs list. Could this have something to do with not being able to install the Windows 10 SDK correctly?
I looked in the install logs, and this is the only error I saw:
[371C:398C][2016-08-08T21:13:35]i301: Applying execute package: {7a68448b-9cf2-4049-bd73-5875f1aa7ba2}, action: Install, path: C:\ProgramData\Package Cache\{7a68448b-9cf2-4049-bd73-5875f1aa7ba2}\vsupdate_KB3022398.exe, arguments: '"C:\ProgramData\Package Cache\{7a68448b-9cf2-4049-bd73-5875f1aa7ba2}\vsupdate_KB3022398.exe" -quiet -burn.related.patch -burn.ignoredependencies={248fcd1e-5ee1-421d-893f-ec0a94dd7b01} -burn.ancestors={248fcd1e-5ee1-421d-893f-ec0a94dd7b01}'
[371C:398C][2016-08-08T21:13:35]e000: Error 0x80070003: Failed to create embedded process atpath: C:\ProgramData\Package Cache\{7a68448b-9cf2-4049-bd73-5875f1aa7ba2}\vsupdate_KB3022398.exe
[371C:398C][2016-08-08T21:13:35]e000: Error 0x80070003: Failed to run embedded bundle.
[371C:398C][2016-08-08T21:13:35]e000: Error 0x80070003: Failed to run bundle as embedded from path: C:\ProgramData\Package Cache\{7a68448b-9cf2-4049-bd73-5875f1aa7ba2}\vsupdate_KB3022398.exe
[371C:398C][2016-08-08T21:13:35]e000: Error 0x80070003: Failed to execute EXE package.
[287C:137C][2016-08-08T21:13:35]e000: Error 0x80070003: Failed to configure per-machine EXE package.
It appears in every log when I try to install vs2015 with the right option ticked, or when I use the standalone installer. I've looked in C:\ProgramData\Package Cache and there is no {7a68448b-9cf2-4049-bd73-5875f1aa7ba2} folder, and none of the other folders contain "vsupdate_KB3022398.exe". It looks like this is the root of the problem.
EDIT: I've created the folder that was missing and added "vsupdate_KB3022398.exe" to it (found it online, hosted on a Microsoft server), and there are no more errors left. However, the problem still isn't fixed. The SDK simply refuses to show up. I think I'm going to have to do a clean install.
I had the issue of Windows 10 SDK 14393 failing to install on Windows 7 OS. This problem occurred when installing as part of Visual Studio 2015 and also running the Standalone Installer for the Windows 10 SDK 14393. According to the logs, the Windows Desktop Extension SDK failed to install.
As a work-around I installed Windows 10 SDK 10586 (Installed successfully)
Then I installed Windows 10 SDK 14393 (Installed successfully)
Both versions of the Windows 10 SDK appear as choices under Target Platform Version in Visual Studio 2015 for me.
Apparently the Windows 10 SDK 14393 installer is missing something which it requires to run successfully on Windows 7. (Something that must be present in the previous version)
Sorry for the difficulty. There are 2 known issues that are causing 'Fatal Error' in the Windows SDK install.
See the Windows SDK Tools Issues Forum.
You probably have (had) a pre-release of the SDK and one of the contracts installed is causing MDMerge to fail during setup. Uninstalling the prerelease version of the SDK should avoid this issue.
Thanks,
kevin
I had the MDMerge problem, after uninstalling all previous Windows 10 SDK toolkits, still couldn't install. Fixed it by moving the contents of: "C:\Program Files (x86)\Windows Kits\10", ran the installer again and it installed fine.
This is what I did and it kind of worked for me. Remove everything in the linker ( PROJECT -> LINKER -> Input -> Additional Dependencies, as can be seen in this screenshot

Visual Studio 2015 Update 3 Installation/Change Fails - "The parameter is incorrect"

I am trying to install the Visual Studio 2015 Update 3, but I am receiving an error each time. I have tried both the web installer and the ISO, and I have also tried going into Control Panel/Programs and modifying the 2015 install. All of these result in the same error: "Setup Engine - The parameter is incorrect". I've read about some of the other issues with the installer, but I'm hoping somebody else might have seen this one or something similar. The logs always have the following error in them:
[1B10:1DA0][2016-07-18T11:39:28]e000: Error 0x80070057: Failed to convert version: to DWORD64 for ProductCode: {284FA9A0-CEDD-81D3-5A19-5858E95FD0C4}
[1B10:1DA0][2016-07-18T11:39:28]e151: Detect failed for package: Win10_Universal_CRT_SDK_Extension_SDK, error: 0x80070057
I have even tried to download the full installer for VS2015, but all installers seem to run through the same error. Any ideas on how I might repair this particular component so the installs will succeed?
Additional information, this is happening on a VM of Windows 10 running in Parallels 11.
Screen shot of installer failing
I found a similar issue here: https://connect.microsoft.com/VisualStudio/feedback/details/974081/visual-studio-update-3-installation-keeps-failing-error-message-setup-engine-the-parameter-is-incorrect
The reply from Heath[MSFT]:
The logs confirm that some of your Windows Installer product
registration is corrupt. For the first issue, open a command prompt
(preferably elevated to avoid multiple UAC prompts later) and run the
following:
start /wait msiexec /fomus {284FA9A0-CEDD-81D3-5A19-5858E95FD0C4} REINSTALL=ALL
That should get
you past the first problem. If it does not, manually remove the
product like so and re-install it from the package cache:
start /wait msiexec /x {284FA9A0-CEDD-81D3-5A19-5858E95FD0C4} IGNOREDEPENDENCIES=ALL
start /wait msiexec /i "C:\ProgramData\Package Cache\{A79F6653-6AF1-4AF2-BC15-F5D6C05E1E6A}v2.0.40326.0\packages\sptoolsDependencies\enu\WorkflowManagerTools_x64.msi" ADDLOCAL=ALL NOVSUI=1
(change the above file
WorkflowManagerTools_x64.msi according to your log file record) After
this, installing VS Update 3 should work.
I had a very similar problem which at its root exhibited the same issue identified above in the Visual Studio 2015 Update 3 setup error (I couldn't install SSMS 17.1 which uses the Visual Studio 2015 Isolated Shell). I tried the solution above which unfortunately did not work for me. I did some more digging through the vs_isoshell.exe log file and found lines similar to those below.
[6BE0:36E0][2017-07-13T13:05:36]i000: Error 0x80070057: Failed to convert version: to DWORD64 for ProductCode: {9A7E3828-17FB-3E0C-9B28-48493E01937A}
The ProductCode refers to the "Microsoft Visual C++ 15 x86 Debug Runtime - 14.10.24269".
A perusal of my installed programs showed I did not have this installed, and I was unable to install it again due to a later version being present (it turns out it was upgraded, or removed, when I installed Visual Studio 2017).
I did some more searching and came across this page which had steps I adapted to my situation. I performed the same registry profiling of the installer with Process Monitor and the same key was missing. I added a key called DisplayVersion (string - REG_SZ) to the path below with a value of 14.10.24629 and that worked.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\8283E7A9BF71C0E3B9828494E31039A7\InstallProperties]
Adding the key/value pair allowed the installation of the VS 2015 Update 3 Isolated Shell to finish successfully which in turn allowed the SSMS 17.1 installation to complete successfully.

Cannot publish .net application or to install Web Deploy 3.5

When I tried to publish my .net application on the server using using Web Deploy 3.0 I got this error:
Web deployment task failed. Microsoft.Web.Deployment.DeploymentBaseOptions' does not contain a definition for 'UserAgent'
Searching the web I found that someone fixed this problem upgrading Web Deploy to version 3,.5.
When I tried to upgrade Web Deploy to the version 3.5 I got this error:
http://sciepa.org/zalek/pictures/WebDeploy3.5Failed.png
MSI (s) (78:1C) [13:26:40:909]: Hello, I'm your 32bit Elevated custom action server.
DEBUG: Error 2738: Could not access VBScript runtime for custom action
MSI (s) (78:54) [13:26:40:916]: Product: Microsoft Web Deploy 3.5 -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2738
Then I tried to get current Web Deploy using Visual Studio 2013, and got this error:
http://sciepa.org/zalek/pictures/WebDeploy3.5FailedWithVS.png
Here are logs of the installation through Visual Studio:
http://sciepa.org/zalek/pictures/Log_with_vs_professional.txt
To fix error code is 2738 someone suggested this command:
[http://www.jakeludington.com/windows_7/20091115_error_2738_could_not_access_vbscript_run_time_for_custom_action.html][4]
I registered vbscript using command:
c:\windows\syswow64\regsvr32 vbscript.dll
c:\windows\system32\regsvr32 vbscript.dll
I also added to the PATH folders where vbscript.dll is located: C:\Windows\SysWOW64\;c:\windows\system32\
but it didn't help.
Any ideas what to do next?
After many hours of searching, repairing system using SFC.EXE /SCANNOW command I found that the problem was McAfee antivirus program. My PC come with McAfee, but I uninstall it it - at least this is what I thought I did.
This page explains how to do it in details:
detail explanation
What I did was to run this program:
McAfee uninstall
Zalek

Resources