UTF-8 characters not displaying correctly in Inno Setup - inno-setup

I've seen a couple of other threads about this but I've spent a while trying to get it sorted to no avail.
Here's a generic version of my .iss file:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define AppName "MyApp"
#define CompanyName "MyCompany"
#define FileName "File Name"
#define AppExeName "App Exe.exe"
#define AppIcon "..\icon.ico"
#define AppId "app.id"
#define AppURL "mywebsite"
#define AppSrcDir "path\to\app\directory"
#define AppTargetDir "{userappdata}\" + CompanyName + "\" + AppName
#define AppVersion GetFileVersion(AppSrcDir + "\" + AppExeName)
#define AppPublisher "Publisher"
#define LaunchMessage "Launch Message"
#define AppProtocol "protocol"
#define OutputDir "path\to\output"
#define SetupFilename FileName + "-setup-" + AppVersion
#define SetupImage "..\setup.bmp"
#define InstallerMessage "Some message with a German character - ö"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AllowCancelDuringInstall=no
AppId={#AppId}
AppName={#AppName}
AppVersion={#AppVersion}
AppVerName={#AppName} {#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={#AppTargetDir}
DefaultGroupName={#CompanyName}
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyPage=yes
DisableReadyMemo=yes
OutputDir={#OutputDir}
OutputBaseFilename={#SetupFilename}
PrivilegesRequired=lowest
SetupIconFile={#AppIcon}
SignTool=signtool
Compression=lzma/ultra64
SolidCompression=yes
WizardSmallImageFile={#SetupImage}
UninstallDisplayIcon={app}\{#AppExeName}
[InstallDelete]
Type: filesandordirs; Name: {#AppTargetDir}
[Languages]
Name: de; MessagesFile: "compiler:Languages\German.isl"
[Files]
Source: "{#AppSrcDir}\*"; DestDir: "{app}"; Flags: recursesubdirs
Source: "path\to\other\installers\win32\*"; DestDir: "{app}\redist";
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"; WorkingDir: "{app}";
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; WorkingDir: "{app}";
[Run]
FileName: "{app}\redist\installer.exe"; Parameters: "/S /v/qn"; WorkingDir: "{app}"; StatusMsg: "{#InstallerMessage}";
The problem I have is that it doesn't display the InstallerMessage text correctly. The ö character does not render correctly.
I am using the Unicode version of Inno Setup (with the "(u)").
I have seen some mentions of using a byte order mark but I haven't seen any examples. I tried converting the whole string using a UTF-8 encoder and added the byte order mark at the start but it didn't work. I'm completely stumped!

Make sure your .iss file uses UTF-8 encoding with BOM.
And of course, you need Unicode version of Inno Setup (the only version as of Inno Setup 6).
Was the string also used in Pascal Script code (what is not, mentioning it just for benefit of others, who may find this question), you also have to use Inno Setup 5.6.0 or later. Earlier versions did not support UTF-8 in Pascal Script.
Pascal Scripting changes:
Unicode Inno Setup: Unicode is now supported for the input source. For example, where before you had to write S := #$0100 + #$0101 + 'Aa'; you can now write S := 'ĀāAa'; directly. Also see the new UnicodeExample1.iss example script.
See also Inno Setup Unicode encoding issue with messages in ISS script.

Related

Inno Setup constants and parameters [duplicate]

This question already has answers here:
Passing in version number to Inno Setup compiler
(3 answers)
Closed 2 years ago.
I'm trying to add a parameter to my setup file, with a default value.
In this case I get a compile error at
OutputBaseFilename=MyApp {param:Version|{#MyAppVersion}} Setup
Saying:
Value of [Setup] section directive "OutputBaseFilename" is invalid
Shortened reference code:
#define MyAppName "My App"
#define MyAppVersion "1.7.24"
[Setup]
AppName={#MyAppName}
AppVersion="{param:Version|{#MyAppVersion}}"
DefaultGroupName=VHStudio
OutputBaseFilename=MyApp {param:Version|{#MyAppVersion}} Setup
SetupIconFile={#PathToRepoRoot}\Development\VHS\VHSStudio\media\logo.ico
[Icons]
Name: "{group}\VHStudio {param:version|MyAppVersion}"; Filename: "{app}\VHStudioApp.EXE"; WorkingDir: "{app}"
Name: "{group}\Uninstall VHStudio"; Filename: "{app}\unins000.exe"; WorkingDir: "{app}"
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\VHStudioApp.EXE"; Tasks: desktopicon
I'm guessing I'm using the constant wrong?
The Strange thing is that I do
AppVersion="{param:Version|{#MyAppVersion}}"
Without any errors...
Based on the comment from Martin. Suggesting to take a look at Passing in version number to Inno Setup compiler.
Turns out I overcomplicated things. You can easily pass parameters to the compiler for pre-processor variables. In my situation MyAppVersion.
What I did in Inno Setup:
#ifndef MyAppVersion
#define MyAppVersion "1.7.24"
#endif
And when compiling it looks like this:
ISCC.exe myProg.iss /DMyAppVersion=1.7.14

how to change the icon of the shortcut of accde in inno setup

Everyone I created a DB and after that, I compile it ACCDE and I use Inno setup for making installer of ACCDE file but I have a problem I want to change the Icon of the shortcut which is created by inno setup on the Desktop. Any idea how to perform this task. Thanks in advance.
Put down {commondesktop} as Name in the Icons section, if you want to make a shortcut on the Desktop Window. That's all.
Assume the name of your ACCDE is "example.accde".
See below.
#define MyAppName "Example"
#define MyAppFullVersion "0.1.0"
#define MyAccdeFileName "example.accde"
[Setup]
AppId={{2D9CC75F-E3DA-4E86-A659-03301DDE1C33}}
AppName={#MyAppName}
AppVerName={#MyAppName} {#'V'}{#MyAppFullVersion}
DefaultDirName={pf}\{#MyAppName}
[Files]
Source: "{#MyAccdeFileName}"; DestDir: "{app}"
[Icons]
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAccdeFileName}"; WorkingDir: "{app}"
Use IconFilename parameter of your [Icons] section entry:
[Icons]
Name: "{commondesktop}\My DB"; Filename: "{app}\db.accde"; IconFilename: "{app}\myicon.ico"

How can i create a directory and copy exe file to this directory while installing my program using InnoSetup?

I have this automatic script that InnoSetup did :
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId=
AppName=VideoScreenRecorder
AppVersion=1.5
;AppVerName=VideoScreenRecorder 1.5
AppPublisher=Daniel Lipman
DefaultDirName={pf}\VideoScreenRecorder
DefaultGroupName=VideoScreenRecorder
InfoBeforeFile=D:\ScreenVideoRecorderHelp.txt
OutputDir=D:\ScreenVideoRecorderCompiler
OutputBaseFilename=Setup
SetupIconFile=D:\Activity Monitor.ico
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "D:\C-Sharp\ScreenVideoRecorder\ScreenVideoRecorderWorkingVersion\bin\Debug\ScreenVideoRecorder.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\VideoScreenRecorder"; Filename: "{app}\ScreenVideoRecorder.exe"
Name: "{commondesktop}\VideoScreenRecorder"; Filename: "{app}\ScreenVideoRecorder.exe"; Tasks: desktopicon
[Run]
Filename: "{app}\ScreenVideoRecorder.exe"; Description: "{cm:LaunchProgram,VideoScreenRecorder}"; Flags: nowait postinstall skipifsilent
The installation take the exe file VideoScreenRecorder and copy it install it in program files directory...etc
What i want to do is to add another exe file to the installation : ffmpeg.exe
I want the installation program will create a directory at specific place for example c:\test and put the ffmpeg.exe at this directory .
The main exe file is VideoScreenRecorder.exe but i also need the ffmpeg.exe to be copied to another specific directory .
The directory where the ffmpeg.exe should be in is :
C:\Users\user name\AppData\Local\ScreenVideoRecorder\ScreenVideoRecorder\workingDirectory
I need the installation directory to create the directory at this place and then copy the ffmpeg.exe to the workingDirectory .
How can i do it ?
You can make DestDir for each file whatever you like, in this case with one of the Constants that Inno Setup has implemented.
[Files]
Source: "X:\PathToFFMPEGSource\ffmpeg.exe";
DestDir: "{localappdata}\ScreenVideoRecorder\ScreenVideoRecorder\workingDirectory";
Flags: ignoreversion
*Where X is the drive letter where your source ffmpeg.exe is located.

Start Menu Folder as a Subdirectory - Inno Setup

I want to add a shortcut to my program in the start menu as follows:
MyAppPublisher\MyAppName\MyAppName
I have this in my script:
DefaultGroupName={#MyAppPublisher}
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
But the start menu folder is always:
MyAppName\MyAppName
Any ideas?
It's as easy as specifying this path in the Name parameter of the entry in the [Icons] section. Your current script creates a shortcut like MyAppPublisher\MyAppName, this one will do what you need:
#define MyAppName "MyAppName"
#define MyAppExeName "MyProg.exe"
#define MyAppPublisher "MyAppPublisher"
[Setup]
AppName={#MyAppName}
AppVersion=1.5
DefaultDirName={pf}\My Program
DefaultGroupName={#MyAppPublisher}
OutputDir=userdocs:Inno Setup Examples Output
[Files]
Source: "{#MyAppExeName}"; DestDir: "{app}"
[Icons]
; notice the full path to the created shortcut, {group} is taken from the Select
; Start Menu Folder page edit box (if shown), which is by default taken from the
; DefaultGroupName directive value; this start menu folder path is then followed
; by the tail of the shortcut path
Name: "{group}\{#MyAppName}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
If you want the group to be in a subfolder, you need to specify the sub folder.
The best way to do this is to append it to the end of the DefaultGroupName directive which will show the correct info in the setup wizard and allow the user to change it to as single folder or another location entirely if they wish.
DefaultGroupName={#MyAppPublisher}\{#MyAppName}
Note that the Start Menu in Windows 8 is not heirachical so any nesting won't be seen anyway.
Found it, my script suggested in the question was correct, for some reason I needed to generate a new GUID for the script for the changes to take effect

Changing AppName and AppDir depending on language in Inno Setup

It's been a while since I was reading some questions/answers concerning InnoSetup, but none of them seems to help me... I want to change the AppName value depending on the language selected, being available English and Spanish. So, if the language chosen when prompted the dialog were Spanish, the AppName value should be "La Bola"; otherwise, if chosen English, the AppName value should be "The Ball".
The same thing applied to the AppDir. The only thing I've found so far was this Inno setup and DefaultDirName, but I cannot make it work with the Languages. Also tried using ISPP conditionals following an example:
#ifdef AppEnterprise
#define AppName "My Program Enterprise Edition"
#else
#define AppName "My Program"
#endif
but yet I cannot make it work with the Language, since I don't know how.
Is it possible to change it? =/
Greetings!
I had the same question, so I'm posting an answer that would allow others to get it faster.
Actually, there is an example in Examples\Languages.iss file in Inno Setup installation folder.
To be short:
[Setup]
AppName={cm:MyAppName}
then
[Languages]
Name: en; MessagesFile: "compiler:Default.isl"
Name: es; MessagesFile: "compiler:Languages\Spanish.isl"
then
[CustomMessages]
en.MyAppName=The Ball
es.MyAppName=La Bola
That's it. For more details, see the example. By the way, note that there is a LicenseFile language attribute available (this is not mentioned in the example):
[Languages]
Name: en; MessagesFile: "compiler:Default.isl"; LicenseFile: "eula_en.rtf"
Name: es; MessagesFile: "compiler:Languages\Spanish.isl"; LicenseFile: "eula_es.rtf"
Look at CustomMessages which can be translated into different languages, These can then be used in AppName and DefaultDirName with the {cm:..} constant.
ISPP is a Pre-Processor, so this means this code run's prior to compiling the SETUP.EXE
The AppName is used for a variety of purposes but one is the SETUP.EXE Resource. Which is why it can't be set at runtime using {code: }
So you could a compile time and have a different SETUP.EXE for each language.
You can do this in a number of ways, using the ISPP, here is one.
#define lang = "english"
[Setup]
#if lang == "english"
AppName=The Ball
#elif lang == "spanish"
AppName=La Bola
#else
# error Unsupported Language
#endif
AppVersion=1.5
;AppVerName=My Program 1.5
DefaultDirName={pf}\My Program
[Languages]
#if lang == "english"
Name: "en"; MessagesFile: "compiler:Default.isl"
#elif lang == "spanish"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
#else
# error Unsupported Language
#endif
[Files]
Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion

Resources