In Inno Setup Scripting, how to check windows version and copy corresponding files [duplicate] - inno-setup

I have built an installer with Inno setup. Recently it was found that some applications do not work in Windows XP. These applications work fine with Windows 7 onward. I need to copy files as per Windows version user is installing on and create program menu shortcuts accordingly. How can I implement this?

All sections have MinVersion parameter, which you can use to limit a specific section entry to a specific minimal version of Windows:
[Files]
Source: "NeedsWin7.exe"; DestDir: "{app}"; MinVersion: 6.1
[Icons]
Name: "{group}\Needs Win 7"; Filename: "{app}\NeedsWin7.exe"; MinVersion: 6.1

Related

Has Inno Setup dropped support for images inside RTF files for Windows 10?

I've recently migrated from Windows 7 to Windows 10 and a specific issue has shown up in Inno installers.
Whenever I create an installer and use the directive InfoBeforeFile and specify a RTF file containing images, those images are not shown.
This began to happen after I migrated to Windows 10 LTSC.
I'm currently using Inno Setup Compiler version 6.2.1, but I'm also experiencing this on older versions too.
Has someone experienced the same?
Thanks.
Following is the code and some images.
Code Snipet:
#define MyAppName "My Program"
#define MyAppVersion "1.5"
[Setup]
AppId={{00000000-0000-0000-0000-000000000000}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppName}
InfoBeforeFile=Pics.rtf
OutputDir=c:\
OutputBaseFilename=mysetup
Compression=lzma
SolidCompression=yes
WizardStyle=modern
[Files]
Source: "*"; DestDir: "{app}"; Flags: ignoreversion
RTF File contents:
Output of Inno Installer:
Link to RTF file:
Pics.RTF
When I open your .rtf file in WordPad, it displays this warning:
When I refuse to display the blocked contents, it does not display the images:
I'm sure that's the same reason, why the images do not display in Inno Setup. Make sure your document does not contain any untrusted contents.
After few tests, it seems that it is caused by images inserted into the document in Microsoft Word. Inserting the same images in WordPad cause no problems.

How to select files to copy as per operating system version in Inno Setup?

I have built an installer with Inno setup. Recently it was found that some applications do not work in Windows XP. These applications work fine with Windows 7 onward. I need to copy files as per Windows version user is installing on and create program menu shortcuts accordingly. How can I implement this?
All sections have MinVersion parameter, which you can use to limit a specific section entry to a specific minimal version of Windows:
[Files]
Source: "NeedsWin7.exe"; DestDir: "{app}"; MinVersion: 6.1
[Icons]
Name: "{group}\Needs Win 7"; Filename: "{app}\NeedsWin7.exe"; MinVersion: 6.1

Execute different command in Inno Setup Run section based on Windows version

I need to know if the Windows is XP, 7, 8, 2003, 2008 or 2012, because depends on version I will run a specific command.
I tried to install IIS in Windows 2008, but it did not work. I tried in Windows 2012 and it worked normally.
Filename: pkgmgr; Parameters: "/iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-Security;IIS-BasicAuthentication;IIS-ManagementService;IIS-CGI;IIS-RequestFiltering;IIS-Performance;IIS-ManagementConsole;IIS-WindowsAuthentication;IIS-WebServer;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-ASPNET;NetFx4Extended-ASPNET45;IIS-ASPNET45;IIS-NetFxExtensibility45;NetFx4Extended-ASPNET45"; Flags: 64bit; Check: IsWin64
I had to run this manually in Windows 2008:
start /w pkgmgr /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-ManagementService;IIS-CGI;IIS-RequestFiltering;IIS-ASPNET;IIS-HttpLogging;IIS-NetFxExtensibility;IIS-HttpErrors;IIS-DefaultDocument;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-StaticContent;IIS-ManagementConsole;IIS-DirectoryBrowsing;IIS-WindowsAuthentication;IIS-WebServer;
Use the MinVersion and OnlyBelowVersion parameters in the [Run] section:
[Run]
; for Windows 2012 and newer:
Filename: pkgmgr; Parameters: "/iu:..."; MinVersion: 6.2
; for older versions (Windows 2008)
Filename: pkgmgr; Parameters: "/iu:..."; OnlyBelowVersion: 6.2
Learn the Windows version numbers.

InstallShield installs to SysWOW64 and not in System32

I'm creating a InstallShield 2012 Spring project, and I need to copy some jpg into System32 subfolder.
In Application Data/Files and Folders, I put that into [WindowsFolder]/System32/akrmf and when install, it copies to SysWOW64/akrmf on Windows 7
The installation project doesn't include any exe or dll, only text files and images.
I tried using [SystemFolder] and copies into SysWOW64 too.
Is there any way to force installation into System32/akrmf folder ?
Thanks
To target the true (64-bit) system folder with Windows Installer, your MSI needs to be a 64-bit package (see Targeting 64-bit Operating Systems). Unfortunately this prevents it from installing on 32-bit systems.
To do this with InstallScript, there are related approaches that do not require creating two separate packages, but you may find it easiest to create two different components where only one is selected for installation.

How do I uninstall Java ME SDK from Windows 7 x64?

I try to uninstall Java ME SDK from Windows 7 x64, but it doesn't work for me.
If I choose Uninstall I get a progress bar, then it goes away, but the Software is still there.
On the first few times I did this, I got the same error message as in I need help UNINSTALLING Java ME SDK:
... show message dialog
title: Critical Error
message: Cannot load native library from path: native/jmesdk/windows/windows-x86.dll
Exception:
java.lang.UnsatisfiedLinkError:
C:\Users\Jonas\AppData\Local\Temp\nbi-8367277139934329064.tmp: Can't load IA 32-bit .dll on a AMD 64-bit platform
In ref to getting the uninstaller to use the 32-bit JRE, the config I attempted that failed to work:
a) Set the PATH environmental variable to point to the 32-bit JRE
b) Windows registry edits in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6 to point to the 32-bit JRE.
In a last ditch effort I renamed \Program Files\Java to Java2, and the uninstaller must have searched to find \Program Files (x86)\Java, the 32-bit JRE, and the uninstall worked.
Seriously, Sun/Oracle. Test your products.
I had the exact same problem and I figured it out. :)
It's because you have the 64-bit JRE installed. Either uninstall it or somehow redirect the J2ME uninstaller to use the 32-bit JRE on your system, so that the 32-bit uninstaller can run instead of the 64-bit uninstaller.
I had the same problem and figured the solution out. As mentioned above you need to make sure J2ME unnistaller only recognizes Java x86. The simplest way I found, instead of unnistalling Java x64, you only have to temporarily rename your Java x64 installation folder to anything you want. That is, rename the folder C:\Program Files\Java to, e.g, C:\Program Files\JavaTEMP.
Now run unnistaller. When finished rename the folder back it's previous name.
That's all.
Hope I helped.
Just perform the following steps and you will be done:
1) Click on the link below and click on any of the ...i586.exe link according to your system
http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
2)Install the software without changing default settings.
3)Run cmd command and type the following:
C:\Java_ME_platform_SDK_3.0\uninstall.exe --javahome "C:\Program Files (x86)\Java\jre8"
4)[optional] uninstall java 8 from control panel which you downloaded to uninstall the above software.
Congratulations.. You just did it!!
Thank you for reading.. Any suggestions or aprreciation is welcomed..
Turns out I had exactly the same problem, uninstall java (TM) 7 64bit and locate the 32-bit java installer bone this download uninstall it and try to install the Sun Java Wireless Toolkit and uninstalled correctly.
Just run this command:
C:\Java_ME_platform_SDK_3.0\uninstall.exe --javahome "32-bit jre location"
Rather than temporarily moving the x64 JRE out of the way, just tell the J2ME SDK uninstaller to use the 32bit JRE:
C:\Java_ME_platform_SDK_3.0\uninstall.exe --javahome "C:\Program Files (x86)\Java\jre7"
Note that this provides the path to a JRE within the "Program Files (x86)" directory, which is the 32bit variant. I only had a Java 7 JRE, but this ought to work with a Java 6 JRE, also.

Resources