How to change System locale in Windows 7 using Command prompt - setlocale

Earlier in Windows XP, Our projects Uses the following code to change the system locale in Windows XP.
driveStr.Format("RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection %.8x 128 %s\\inf\\intl.inf", lgid, getenv("windir"));
Now we migrated the project to Windows 7, Whenever we try to change the language using above format, Application crashes. Later figured it out that the file Intl.inf which used in Windows XP is not part of the Windows 7 anymore which causes the application to crash.
Please let me know, Is there any way to change the system locale on Windows 7 using Command prompt

Related

How can Microsoft XML Parser 4.0 be installed from Inno Setup?

I need to install Microsoft XML Parser 4.0 from Inno Setup.
How can that be done?
I was given a task to embed MSXML in the installer of ours. It's a proprietary piece of software our company makes (for accounting, it uses XML to store and exchange data). Apart from modern systems It's also going to be installed on many old systems using Windows XP.
I'm using Inno Setup 6.1.2.
Also, is there a quiet mode of installation as an option? So the users won't have to click anything and just be notified that MSXML was installed?
Did you Google this?
https://silent-install.net/software/microsoft/msxml_parser/4.30.2107.0
Eg:
msxml.msi /qn /L* "%temp%\XML Parser 4.30.2107.0.log" /norestart ALLUSERS=2
If you look at the Msiexec (command-line options) it does say the qn switch will display no user interface.
Somewhat of an aside, the requirement of installing both on XP and on 'modern' systems may create a conflict that you or your installer will have to resolve.
From Installing and Redistributing MSXML 4.0:
System Requirements
MSXML 4.0 is supported in Windows Server 2008 R2, Windows 7, Windows
Server 2008, Windows Vista Windows Server 2003, Windows XP, and
Windows 2000
From Installing and Redistributing MSXML 6.0:
System Requirements
MSXML 6.0 is supported in Windows Vista; Windows 2000 Service Pack 4;
Windows Server 2003; Windows Server 2003 Service Pack 1; Windows XP
Service Pack 1; Windows XP Service Pack 2.
MSXML 6.0 is preinstalled with Windows Vista. For earlier versions of
Windows, you can install MSXML 6.0 as a separate download.
So you can only use MSXML4 below Vista. And with Vista and above you should be able to reply on MSXML6 already existing.
Your installer could perform an OS version check (alt ref) and then only install MSXML4 if needed. Or you might be able to detect specifically if MSXML6 is installed and then install MSXML4 only if not (assuming therefore its an older system).
But I would test your application (if you haven't already) and see if it will run against MSXML6; it may, without changes. If so then I would forget MSXML4 and include MSXML6 in the installer instead (*). That way your installer could just run it 100% of the time, and expect that on Vista and up it would just do nothing. Your installer would therefore be simpler plus you would be taking advantage of "MSXML 6.0 provides security and performance improvements over earlier MSXML versions." noted here.
(*) Unless you have to run on WinXP pre-SP1?

BadImageFormatException 0x8007000B only on Windows Server 2012 R2

I have a ASP.NET 3.5 application that includes a 32-bit DLL. It works fine (and has for years) on Windows XP, 7 and 10. I am adding support for Windows 2012, 2012 R2 and 2016. It works on 2016, but does not work on 2012 R2.
At the first call to the DLL, the following error occurs:
BadImageFormatException: An attempt was made to load a program with an
incorrect format. (Exception from HRESULT: 0x8007000B)
The same build and install script is used for all OS's tested. Each OS is on a VM on the same machine, so the hardware for all OS's is identical. For each OS:
OS is fully updated.
vcredist 9.0 (x86) is installed as part of the installation.
IIS DefaulatAppPool has 32-bit applications enabled.
I've tried all the suggestions in the posts I've found on this problem, but nothing works. Any ideas?
Double check in Task Manager that your W3WP.exe process for the application is running 32-bit and that it is in fact Default App Pool that is trying to load the DLL. This error message almost certainly means 64-bit process trying to load 32-bit DLL.

Getting current version of Windows 10?

I'm having a problem with installscript, and I'm trying to get the OS Version and detect if it's windows 10.
The Key that I'm trying to get is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\[CurrentVersion]
Using regedit, Windows 10 has the value 6.3 there. The same has Windows 8.1 and Windows 2012.
But, if I use WINVER on commandline, I get 10.0. How can this be?
Instead of reading the value CurrentVersion, read the new values CurrentMajorVersionNumber (which is 10) and CurrentMinorVersionNumber (which is currently 0) under Windows 10. Those 2 keys are new in Windows 10 to detect Windows Version from Registry.
At runtime, you need to have your application manifested correctly in order to get the right value from the version checking APIs; see this MSDN topic on how to set it up, and then you can use the Version Helper APIs to get the right value. I don't know how much of that you can do within your installer project though.

MSHTML Browser Emulation set to 0x0 crashes application in Windows 10

If you are using mshtml as an embedded browser in Windows and want it to render in the latest installed render model (i.e. using the latest installed IE) you can use the following registry Key:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION
And add your program name and the number "0x0". Normally you set it to a value to correspond to a specific IE version, but in my program I always want to use the latest installed version.
In Windows 10 this does not work anymore. Setting "0x0" then crashes the application if rendering a local page or gives a blank page for an Internet page. The "0x0" setting works fine with IE6-11 and Windows XP to Win 8.1.
Not setting anything gives either IE6 quirk mode or IE7 quirk mode. Setting it to "11001" in Windows 10 also works.
Is this a bug in Windows 10? (I know that the "0x0" setting is not documented...)
How do I get the latest installed Browser Emulation no matter what Windows version or IE I have installed?
P.s.
If an upgraded IE is installed after my application I still want the latest version.

installshield: Windir returns c:\documents & settings\fcuser\windows instead of c:\windows

we have a setup developed in installshield vr 6.3. it is a self extractable single setup. it work fine in most on most of the Windows version but on Windows server 2003 64bit in Execution mode when doing RD it return user windows directory against WINDIR i.e. c:\documents & settings\fcuser\windows instead of C:\Windows. According to http://support.microsoft.com/?kbid=186499 it should work fine when i change the compatibility bit of Setup but it didn't. i tried changing compatibility bit of these key too (INSTRUN, SETUP and SETUP1 ) but it didn't work either. but when i when i run the setup within the self extractable by extracting it work fine.
InstallShield 6.3 is 10 years old, released when Windows 2000 had just come out. There were no 64-bit Windows OSes at that time. I'm not surprised you're having trouble. You really should think about using a modern version of InstallShield, or migrate to something like Wix/NSIS if upgrading is not financially possible.
As I work-around to using WINDIR, you could try getting this Registry value:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRoot
Or try to get the value of this environment variable:
%SYSTEMROOT%

Resources