Inno Setup word completion doesn't work at all - inno-setup

How does word completion work in Inno Setup?
If I press Alt+Right at the middle or at the end of any identifier or word in the code, nothing happens.
I can't find any extensions to install and I can't find answers on the internet to this topic...
(Inno Setup Compiler v. 6.2.0)

Inno Setup compiler IDE can complete:
Section names
Standard section directives, parameters and flags
Constants
Preprocessor directives
Pascal Script event function names
Nothing more. So indeed, it's not very useful in the Pascal Script code.

Related

How to force using /NORESTART and other flags without using command line

Is it possible to force using some flags like /NORESTART, /NOCLOSEAPPLICATIONS or /VERYSILENT in Inno Setup without using command line?
There's no generic solution to your question that would cover all switches. Implementing a functionality of each switch needs an ad-hoc implementation (and hence requires a separate question).
Actually, you can use .inf file instead of the command-line. But I assume that this not what you ask for.
/VERYSILENT is answered here already:
Run installation using Inno Setup silently without any Next button or Install button.
I'm answering the /NORESTART switch here.
You can hide Yes/No restart radio buttons (and select the No). And update the screen text accordingly.
See Avoid restart prompt in Inno Setup.
Additional handling is needed if you have postinstall entries in the [Run] section.

Choosing install language programmatically in 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.

Change Inno Setup messages from Pascal code

I need to change ConfirmUninstall, UninstalledMost (just in case), and UninstalledAll specifically from script to set a condition. Something like this:
if FileExists(ExpandConstant('{app}\Slash.exe')) then
SetupMessage(msgConfirmUninstall) := FmtMessage(SetupMessage(msgConfirmUninstall), ['Dagon Slasher'])
else if FileExists(ExpandConstant('{app}\Frank.exe')) then
SetupMessage(msgConfirmUninstall) := FmtMessage(SetupMessage(msgConfirmUninstall), ['Dagon Frankenstein'])
else
SetupMessage(msgConfirmUninstall) := FmtMessage(SetupMessage(msgConfirmUninstall), ['Dagon Video Tools']);
But this doesn't work. These messages are used in MsgBoxes, so I can't think of any other way. Running in silent mode is not really suitable for me, since setup will run uninstall if the programs (or one of them) has already been installed, so I don't want the user to accidentally uninstall the program by running the setup.
You cannot change these easily, see:
Replace or customize modal uninstallation windows in Inno Setup
Regarding the silent uninstall solution: I do not understand your problem with "setup will run uninstall if the programs (or one of them) has already been installed".
I assume you run the uninstaller only after the user confirms (s)he wants to install the new version, so you actually want to run the uninstaller silently, right?
And anyway, there's nothing that prevents you from running the uninstaller non-silently from your installer, even if the entry in "Add/Remove programs" refers to "silent" installation.
You can use generic messages that covers all setup types:
[Messages]
ConfirmUninstall=Are you sure you want to completely remove this game?
As your uninstall messages depend on a type of the installed application, you can modify the installer to:
Create custom "type" page (like a menu) as the very first one.
Once the user selects the "type", restart the installer with a custom switch (e.g. /APPTYPE=slasher) and exit.
Once the installer is (re-)run with the /APPTYPE, you know from the beginning, what component/type you are installing and hence you can set the AppName accordingly (using a scripted constant).
Of course, you skip the custom "type" page.
This is actually not difficult to implement. The only drawback is that the setup window is "recreated" after the user selects the "type".
I've sketched this solution already in my answer to Inno Setup Change AppName based on component(s) selected.

NSIS guidelines

I want to make my NSIS code more readable.
I need some guidelines regarding writing code section wise (like there is #region #endregion in C#) or any such information that can make writing NSIS code interesting and easy.
Please help me out.
Also there is Visual Studio (2008, 2008, 2010 and 2012) addin available called Visual & Installer.
It offers a lot of features like syntax highlighting, navigation, (GoTo definition, Goto reference, navigation bars, open file at cursor, ...) also IntelliSense support and much more.
Try here: http://www.unsigned-softworks.sk/visual-installer/
If you are looking for an IDE, you can try with SciTE that supports code folding, colorization, makensis compilation from the editor and compilation errors parsing. (BTW: Scite is not actually an IDE, but rather a very light yet powerful text editor with built-in support for colorizing and compiling programming languages)
With the latest versions of SciTE, you just need to uncomment the loading of NSIS support that is not enabled by default.
Also, there is the Development Environments section of the NSIS wiki that can point you some alternatives (like adding NSIS support to Eclipse).

Auto code completion in VIM?

Can VIM do auto code completion like what Eclipse does? Usually I connect to my Linux developing server through Putty from my Windows laptop. So, I hope I can find a plugin for VIM which can do drop-down menu like auto completion when I can type variable names in Putty, is this possible?
Thanks!
Yes, in a sense - Vim has Completion commands that can help you automatically find the completion text for partial variable names.
In a nutshell, type a partial variable name and then press CtrlP to search for a matching name.
Yes, it's possible. Vim already features that general style of code completion built-in, under the name of Omni completion.
The default installation doesn't allow for auto-invocation, but if you install this script, that allows it to happen.
Note that, depending on the language you'll be working with, you may need additional scripts to handle auto-completion for that language, and may even need to change the auto-invoke script to recognize when to invoke the completion. Since you haven't said what programming language you'll want to work with, it's a bit hard to say if you need more than this, but I recommend checking the help file.
Try to use http://eclim.org/ - using eclipse core with VIM via plugins.
To not start the complete ecplise core but have a C/C++ member completion, try
http://www.vim.org/scripts/script.php?script_id=1520
- Complete namespaces, classes, structs and union members.
- Complete inherited members for classes and structs
(single and multiple inheritance).
- Complete attribute members eg: myObject->_child->_child etc...
Currently vim has no of plugins for the auto code completion feature, I am using youcompleteme plugin, combined with vim-snippets, ultisnips and supertab plugins. You can tab complete the code using snippets (a small text which can be expanded for full code), and a large number of languages are supported.
For simple text files also a drop down menu comes for the words you have typed earlier.

Resources