Search code examples
qtinternationalizationinno-setupqmake

How to pass international text from Qt .pro/pri file to ISS script


I am using QtCreator and Inno setup to create an international installer that supports English, Japanese and a host of other languages

The approach taken before I came onto the project is to create the Inno setup script dynamically during the build using build variables and the echo command, ie:

In the Qt .PRI file

system(echo <some ISS command here> >> myfile)

This works fine for standard text eg

system(echo if IsWin64 then >> $$ISS)
system(echo begin >> $$ISS)
system(echo HKey := \'Wow6432Node\'; >> $$ISS)
system(echo end >> $$ISS)

creates in the ISS file

if IsWin64 then
begin
HKey := 'Wow6432Node';
end

However we now also want to write some foreign language text to the script file for warning messages, eg

system(echo alreadyInstalledMessage := \'La version XYZ est déjà installée.\'; >> $$ISS)

This should appear in the .ISS file as

alreadyInstalledMessage := 'La version XYZ est déjà installée.';

But its appearing as

alreadyInstalledMessage := 'La version XYZ est d‚j… install‚e.';

I'm guessing this is down to character encoding but cannot find anything on either the echo command or QMake to get it to do what I want.

Anybody know what the magic rune is to get the text to pass from the .PRI file to the .ISS file maintaining all characters. Or is there a better way?


Solution

  • You cannot achieve this with Qt 4 qmake unfortunately.

    However, you could use the 'log' qmake function with Qt 5 which would serve the purpose you need. This is just for your convenience as qmake cannot do what you are trying to achieve here.

    It is also feature frozen, so it is most likely not getting any useful feature backported.

    You will need to reiterate your project, and solve this in a different manner.