2

In Inno Setup, while updating an application, how to get the language of the previous installation and skip asking for language again?

During the first time installation, the languages listed in the [Languages] section for example,

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "hindi"; MessagesFile: "compiler:Languages\Hindi.islu"

would be displayed to the user.

When the application is being updated, I want to skip the language selection and use the same language that the user has selected in the previous installation.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Balaji Vignesh
  • 446
  • 1
  • 7
  • 19

1 Answers1

3

First, you better do not display the language selection dialog at all.

Let Inno Setup pick the right language according to system language by setting ShowLanguageDialog to auto:

[Setup]
ShowLanguageDialog=auto

To answer your actual question: By default Inno Setup does not show the language selection dialog on upgrade, as UsePreviousLanguage is set to yes by default.

[Setup] 
UsePreviousLanguage=yes

Make sure you didn't set it to no inadvertently. Or that your installation does not meet requirements (like AppId without constants).

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • Is it possible to change ShowLanguageDialog using pascal script? I can detect whether the application is already installed or not. – Balaji Vignesh Mar 06 '18 at 08:26
  • I believe you have already discussed this at: https://stackoverflow.com/q/49106616/850848 => It's not possible. All you can do, with some effort and hacks, is to reimplement the dialog from the scratch. – Martin Prikryl Mar 06 '18 at 08:28
  • To reimplement the language selection dialog, see [Inno Setup - Language selector with VCL Styles](https://stackoverflow.com/q/41021292/850848). – Martin Prikryl Mar 06 '18 at 08:33