Preinstalling Driver on Windows 8.1 Fails - guid

We have a few driver packages that we pre-install in the driver store on Windows with SetupCopyOEMInf, following Microsoft's suggested procedures. This process has worked properly for years; no problems on XP, Vista, 7, and even 8.
While evaulating Windows 8.1 RTM, we found that our drivers were no longer pre-installing.
Checking the setupapi.dev.log, I found:
!!! sto: Failed to query boot critical status of device class. Error = 0x00000002
and later:
!!! idb: Failed to query inbox status of device class {ff646f80-8def-11d2-9449-00105a075f6b}. Error = 0x00000002
!!! idb: Failed to publish 'C:\Windows\System32\DriverStore\FileRepository\[ourinfname].inf_x86_3361fc76cd85b678\[ourinfname].inf'. Error = 0x00000002
I've poured through documentation, trying to find out what we're doing incorrectly.
Preinstalling from the commandline with pnputil.exe -a or using InstallScript's DIFxDriverPackagePreinstall() produce the same results.
The drivers work on Windows 8.1 if we DON'T try and put them in the driver store. The preinstallation also works if we upgrade a Windows 8 machine that already had our drivers on it to Windows 8.1. In either case, once it's working, it continues to work.
Why is this failing on Windows 8.1?

After two weeks of digging and debugging, it turns out the problem was with our Device Class GUID.
After stripping our INF down to the bare minimum and comparing with another INF that DID properly preinstall on Windows 8.1, I realized that the only difference between the two was the class GUID. I did a quick search for ff646f80-8def-11d2-9449-00105a075f6b and turned up over a thousand hits; not exactly what you want to see from a unique identifier.
I then looked back through 12 years of version control, and found that the person responsible for originally creating our device drivers didn't change the GUID in the wizard-generated INF from the Win2K DDK.
Creating a new unique class guid solved the problem, and our drivers preinstall properly on Windows 8.1.
I don't know if Microsoft is blocking preinstallation attempts with that GUID specifically, but the bottom line is: if an example says to change the GUID, CHANGE IT!
Here's the sample code for completeness. Don't do this:
;; ********* PLEASE READ ***********
;; The wizard cannot create exact INF files for all buses and device types.
;; You may have to make changes to this file in order to get your device to
;; install. In particular, hardware IDs and logical configurations require
;; intervention.
;;
;; The Win2K DDK documentation contains an excellent INF reference.
;--------- Version Section ---------------------------------------------------
[Version]
Signature="$Windows 95$"
Provider=%ProviderName%
; If device fits one of the standard classes, use the name and GUID here,
; otherwise create your own device class and GUID as this example shows.
Class=NewDeviceClass
ClassGUID={ff646f80-8def-11d2-9449-00105a075f6b}

My previous answer was actually a bit of a red herring. While one should definitely not use the GUID in the sample INF, the REAL problem ended up being with our installer. Turns out, our installation was trying to pre-create the registry key for the class:
HKLM\SYSTEM\CurrentControlSet\Control\Class\{FF646F80-8DEF-11D2-9449-00105A075F6B}
Removing this from our installer fixed the problem.
Microsoft must have changed how driver preinstallation works under the hood from previous versions of Windows.

Related

Manually Crash Kamailio in mi_xmlrpc module?

I am beginner to the kamailio opensource project..i want to crash the kamailio manually to generate core file and debug it later ...I have tried using abort() and printing character array with integer identifier but no success..
can anybody know how to do it?
First: note that MI control interface was deprecated many years ago and all related code was removed starting with Kamailio version 5.0.0 (released in February 2017) -- that included removal of mi_xmlrpc module. So you work on a very old release (v4.4.x or older), no longer maintained.
To your actual question: look at the cfgutils module, it implements the abort() function that should crash kamailio. Note also that you may not get the core dump file on some operating systems if you do not run kamailio under root (privileged) user and you do not have lifted the limit for core file size (use 'ulimit -c unlimited' before starting kamailio). Moreover, some applications such as apparmor can 'hide' the crash result.

Add optional operation to Qt Installer

I'm creating a fairly straightforward offline installer for my product using the Qt Installer Framework (v3.0).
The product includes a driver installer for a Sentinel HASP protection key. Ideally I would like to present the user with an option to skip running this driver installer (in the case where they have already installed this driver with a previous product installation, for example), but I can't seem to find a concise example in the QtIFW documentation of the best/simplest way to achieve this.
The size of the driver is relatively tiny compared to the size of the main product package, so there's no concern with always including the file.
Let we have driver-installer.exe that installs that driver.
If you want to make its execution optional you can add failed return code as accepted return code for this execution like below
component.addOperation("Execute", {0,xxx}, "driver-installer.exe");
Here xxx should be replaced with your failed return code

"Swing-Shell" java.lang.InternalError: Could not initialize COM: HRESULT=0x80010106

I have a Java 9 app that I'm trying to package for the Windows Store. The strange thing is that it works as expected when I run the exe-launcher directly, but I get the following strange error when I run the launcher via the APPX package:
Exception in thread "Swing-Shell" java.lang.InternalError: Could not
initialize COM: HRESULT=0x80010106
at java.desktop/sun.awt.shell.Win32ShellFolderManager2.initializeCom(Native Method)
at java.desktop/sun.awt.shell.Win32ShellFolderManager2$ComInvoker$1.run(Unknown Source at java.base/java.lang.Thread.run(Unknown Source)
HRESULT=0x80010106 means RPC_E_CHANGED_MODE which I guess means that COM is somehow already initialized in MTA mode. But why is this only an issue in the Windows Bridge sandbox? Does the Windows Bridge somehow pre-initialize COM somehow for some reason?
I'm not sure if this is a Java 9 issue, or a Desktop Bridge issue, or both. Does anybody have any ideas on how to identify the cause of the issue or workaround?
I have made a minimal Sample Project to reproduce the issue
The application works when executed directly, but not when executed via the APPX launcher. Why?
Analysis
The JDK parts, that rely on COM being initialized (D3DPipeline, Sound and windows shellfolder access) all follow the same pattern:
the run the code in a separate thread
for this thread CoInitialize is called
at the end of the user level code CoUnitialize is called
This is in line with the documentation the MSDN holds for COM and the analysis is correct, the error indicates, that the COM subsystem is already initialized to be MTA threaded.
So I modified the java launcher (jvm.dll) and inserted
debugging statements into some of the native methods in os_windows.cpp.
I focused on the threading methods. What I found was this:
create_main_thread, create_os_thread, pd_start_thread all
run with COM not yet initialized
the native thread initializer (thread_native_entry) is already
running with COM initialized
I looked more into in _beginthreadex and indeed I finally found a lead
on stackoverflow. That pointed me to the sourcecode of threadex.c,
which is part of the Visual Studio 2013 Express Installation.
There you find, that _beginthreadex does not directly start the
supplied thread function, but runs a library initializer
(_threadstartex) first. Part of this initializer reads:
_ptd->_initapartment = __crtIsPackagedApp();
if (_ptd->_initapartment)
{
_ptd->_initapartment = _initMTAoncurrentthread();
}
_callthreadstartex();
_crtIsPackagedApp detects via a kernel function if the application is
run as a "PackagedApp" (i.e. AppX package) and if so, then the
RoInitialize function is called, which from my understanding acts like the big
brother of CoInitialize.
Long story short: If your application is build with Visual Studio 2013
and run as a packaged application, you get a broken environment.
It was confirmed, that the working versions of the Oracle JDK were build with VS2010 SP1 and the broken version was build with VS2013SP4.
Workaround
With the above information google finally found a reference, that supports the analysis:
https://blogs.msdn.microsoft.com/vcblog/2016/07/07/using-visual-c-runtime-in-centennial-project/
Quote from that article:
Note that the existing VC++ 12.0 libraries created during the
Windows 8 timeframe have runtime checks to determine whether the
app is running under the app container or not. When running
desktop apps as a packaged app, these checks might limit the
functionality of the desktop app or cause it to behave like a UWA
(Universal Windows Application) (limited file system access or
create thread initializing MTA etc.). We have fixed this behavior
in the VC++ libraries contained in these framework packages and
thus removing the modern app limitations from your desktop
applications.
So I see to options to fix applications, that shall be distributed as AppX packages:
either force the users to have the updates VC++ 12.0 binaries installed (by introducing the dependency cited in the blog post) or
replace the msvcr120.dll that is bundled with Java 9 (and I assume also Java 10) with the fixed version from the update packages
I would go with the second version and I tested this. Starting with a clean up-to-date Windows 10 System, I installed JDK 9.0.4, I cloned the supplied testcase, modified it use the locally installed JRE (not the JDK!) and build the appx package. Running this, I reproduced the problem. I then replaced the msvcr120.dll's in the JRE folder of my systems installation with the one contained in the APPX container from:
https://www.microsoft.com/en-us/download/details.aspx?id=53176
Hint: *.appx are just ZIP files with additional signatures, so you can
just rename them and extract the contents.
I rebuild the testcase and it is working as it should (no COM
initialization errors anymore).

obtain data from remote computers using autoit

I have been maintaining a program written in batch. I want to write a replacement program using autoit.
The program is downloaded to the desktop of remote computers and prints out a log of the scan results in notepad on the desktop.
I want it to cover windows XP-vista-7-8-8.1-10. At the moment it does not cover 8-8.1 or 10.
This is the printout:
Results of my test version 001
Windows 7 x86 Service Pack 1 ---- (shows in brackets if service pack is out of date)
(UAC) --- shows if UAC is on or disabled.
Internet Explorer----(shows if out of date)
Antivirus/Firewall Check:
Windows Firewall Enabled!
Panda Free Antivirus
WMI entry may not exist for antivirus; attempting automatic update.
Anti-malware/Other Utilities Check:
CCleaner
Java 8 Update 31 (Java version out of Date!)
Adobe Flash Player 17.0.0.188
Adobe Reader XI
Mozilla Firefox (38.0.5)
Thunderbird (38)
System Health check
Total Fragmentation on Drive C: 2%
````````````````````End of Log``````````````````````
So this is possible. To get versions of files(like java and firefox) I think you can use FileGetVersion
To get if windows filewall is enabled you have to read the registry. This key might be a little bit different depending on your system but the one for me was this one
RegRead("HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\", "EnableFirewall")
These two macros should be usefull to determine OS specific information that you request
#OSType
#OSVersion
UAC can also be read from the registry and as with the firewall it might depend on your system but for me this was the registry:
RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA")
Im not quite sure what the Total Fragmentation means so I am not sure how you can get this.
You should be able to compose a txt file with all this information. You should be able to find examples of autoit code that transfers text files just by searching here on stackoverflow or on google.

32bit-64bit Installer Help

Looking for help to build a 32/64 bit installer. I've looked for help here already, found some from Mithriel but unfortunately I'm very new to editing registry keys.
I replied to his answer and posted my script but a Mod removed it. I apologize for any gap in etiquette.
I'm using InnoIDE to develop my installer. Essentially I just want it to be able to detect the chipset architecture and then load in the appropriate registry values.
From what I understand it looks like many are creating a parent installer that runs two other installer (one for 32 and 64 respectively). That's great but the files I will be copying to the install directory are about a GB. I can't really have those files
duplicated obviously.
I'm also looking for a way to delete a folder on install as well.
I can post script/email it to anyone willing to help me out.
J.
A little bit on "why" there is a need for a 32/64-bit installer. This doesn't answer the question, but has evolved too large for a comment. See the other comments in the original post.
The "problem" with using a 32-bit installer for a 64-bit application (and vice-versa) is due to Windows Registry Virtualization.
A 32-bit installer will (unless it uses special flags when writing to the registry write to the "32-bit view" of the registry and the application will see the "64-bit view"). If the application itself only runs in 32-bit then this doesn't matter and only a 32-bit installer is needed, of course. Like wise, if it only runs in 64-bit then only a 64-bit version of the installer is needed.
Happy coding.
while using inno setup i found a problem to writte to the 64 bits registery it seems that is differnet instruction while writting on 32 bits.
so it need more search and i will not got stocked for this.
Without being more specific with the question, the registry section of the documentation includes specific constants for 32- and 64-bit registry options. For example, see this section:
The values may have a suffix of 32 or 64. Root key values with a
suffix of 32 (for example, HKLM32) map to the 32-bit view of the
registry; root key values with a suffix of 64 (for example, HKLM64)
map to the 64-bit view of the registry.
Make a set of registry entries for each bit-ness, and in each entry, specify the the 32- or 64-bit registry root, and add a Check: IsWin64 parameter for the 64-bit registry entries. You should be able to invert that check on the 32-bit entries.

Resources