Choosing install language programmatically in Inno Setup - inno-setup

I'm using Inno Setup as an installer for my program, but I want to be able to choose the default language for the installer itself. I know it chooses default based on system locale (based on a list of languages I've chosen to support), but I would want to select the language according to my rules.
The rules is that for "Norwegian" and "English" OS, I want to show Norwegian, while all other gets defaulted to their own.
After loads of Googling I have not found an answer to this, and it's very possible it just can't be done. But I am also aware that Inno Setup's documentation is rather lacking, so I'm hoping maybe someone knows something which is not written down.

Disable the standard language dialog by setting the ShowLanguageDialog to no.
Do your "language decision logic" in InitializeSetup event function.
Re-launch the installer with /LANG switch.
Basically you can use the code from below question, except that instead of presenting a custom language selection dialog, you do your "decision logic".
Inno Setup - Language selector with VCL Styles
Though for your trivial case, why don't you just create an "English" .isl (LanguageID directive set to $0409) with Norwegian contents?

[Setup]
LanguageDetectionMethod=none
Setup will use the first language specified in the [Languages] section as the default language.

Related

Upgrading application - desktop icons - Inno

If a user has Star Dock Fences installed and they have moved the desktop icon into one of the fence panels, I find that whilst the short-cut will get removed during the upgrade it is then just re-inserted back on the desktop and I have to drag it back into the fence panel.
Is there some way we can keep it in the same fence panel or is this over complicated to detect on the target PC?
So, in my script I have:
Name: "{autodesktop}\Meeting Schedule Assistant"; \
Filename: {app}\MeetSchedAssist.exe; Tasks: desktopicon;
Here it is in a fence:
According to the icon properties it is desk a desktop short-cut, even though it is inside a Stardock Fence:
So it is a shame that the new one does not stay in the same place. I don't want to use the uninsneveruninstall flag if I can help it.
I have been provided with an answer here. No changes are required to the Inno Setup script.
Rather, the user can make a specific change to the Star Dock Fences. It has to do with Name-based rules:
By using criteria you can isolate a short-cut and tell it which fence panel it should belong too.
To quote the aforementioned link:
You can setup a fence which has a name rules set to it. Usually any program will still use its original name whenever it upgrades. So if you set the name rules it will always be moved to that specified fence when it upgrades.
Inno Setup just place a shortcut on desktop because this is specified in the configuration file. If you want to place on different locations, add them to the configuration.
You can read this guide to learn more about icons/shortcuts.
About avoiding shortcut being moved to desktop, you probably can't because Inno identifies that there's no shortcut on desktop. Anyways, you can avoid Inno Setup from changing any shortcut.
You can use the flag: uninsneveruninstall.
This answer might help you: Renaming/replacing ShortCut During Inno Setup Installation
If you don't want to use uninsneveruninstall flag, i suggest you try to add version to shortcut's name.
E.g. Name: "{autodesktop}\Meeting Schedule Assistant 1.0"; \
This guy explains.

Inno Setup: Color for modal and browse directory windows

Is it possible to change inner background color for modal and browse directory windows in Inno Setup? In my case I want it should be white.
UPD: Same behaviour is on the inner pages of Inner Setup, but I've fixed it by setting WizardForm.InnerPage.Color := clWhite;
I'm using VclStylesInno for styling my installer with custom style spreadsheat.
You cannot change the color of these in Inno Setup itself, except by a custom build of Inno Setup or some addon DLL (see below).
All you can do is to re-implement these dialogs from the scratch:
For the "browse" dialog: Handle the WizardForm.DirBrowseButton.OnClick and use CreateCustomForm and TFolderTreeView to implement the browse dialog. Download Inno Setup code and copy the existing implementation from SelFolderForm.pas.
For an example of handling WizardForm.DirBrowseButton.OnClick, see
How to display localized Program Files name (display name) during installation?
For the "cancel" dialog: Implement the CancelButtonClick event function. Make sure you set Confirm to False to get rid of the default prompt. And implement your own. Again, use the CreateCustomForm.
It's a lot of work for a small gain. I'd not do it.
Instead, you can use VCL Styles for Inno Setup (DLL) to style Inno Setup windows (including all modal dialogs).
As turned out, the reason was in the "Colors" option in Bitmap Designer, which I use to modify my installer style. This option makes some additional styling for controls:

Choose a folder dialog for nsis

I have a problem with the skin that I am using for my nsis installer.
Is there a way to control to not apply skin to choose a folder dialog.
I am using Skincrafter plugin to apply this skin.
Generally if I load it after initializaiton, it applies to all pages/inner dialogs and child dialogs. I do not want Browse for a folder dialog to have a skin.
Can someone please provide any suggestions?
There is no way how to fix this from NSIS.
Asks the authors to add this feature for you or (if the sources are available) modify the it by yourself to fit your needs.
There are also some other skinning systems for NSIS - e.g. mine Graphical Installer (sorry for this little promo :) so you can try to use them.

Why my Poseidon For Uml Garbled?

I downloaded a Poseidon for UML 8 - Installer (Community Edition 8.0.0).
When I do exit operation or some other operations, I got code Garbled Dialog as:
It looks like you are running Windows is in a language (eg. Chinese) that is not supported by the software. Some dialogs like Yes/No dialogs and file open dialogs have translations for other languages but the font used in the software does not display the characters correctly so you just see empty boxes.
It should be easy to guess on most dialogs what they should say, in your example the buttons probably say Yes, No, Cancel.
You can change the language in Windows to English and it should work.

How do you package a keyboard layout for Windows 8?

I've been searching for a way to do this. I use a slightly modified Colemak keyboard layout and I can't figure out how to add it as a supported input method in the new language selection in Windows 8. The installer that the Colemak guys distribute sort of works; you can choose the layout after installing it, but it forces the EN-us language, and can't be chosen for other languages.
If anyone knows how to do this properly, I'm sure the Colemak guys would appreciate hearing about it, and it would let me make the modifications I want to.
I don't know if this is the exact issue but there is a problem with MSKLC-generated layouts in Win8 (DP&CP).
You can choose the language if you make your custom keyboard layout with MSKLC: in the "Properties" part, or, if it does not work (though I'm sure it does), you can edit the .klc file manually.
Build it and setup with the executable. You are done.

Resources