Inno setup a simple update - inno-setup

Is it possible to use same Inno Setup installer for installing new or updating/upgrading application. For example If the application is already installed the installer will check current version against newly availible. If it is true then I would like the installation procedure to be silent, meaning showing only the progress of update and not all availible installation features (e.g. folder location e.t.c). Thanks.
=======
The solution to the problem was :
Passing the parameters /SILENT/SUPPRESSMSGBOXES
taken from
http://www.jrsoftware.org/ishelp/index.php?topic=setupcmdline

For the standard screens, simply add the following to your [Setup] section:
[Setup]
DisableDirPage=auto
DisableProgramGroupPage=auto
This will automatically hide the directory and group selection pages on subsequent installs (using the previously selected values, by default, unless you've used other settings that disable that behaviour).
Components and Tasks will still display, but that's usually a good thing as it allows the user to add additional components or re-perform certain tasks. (Note that you can use the checkedonce flag on [Tasks] entries to only tick them by default during the initial install, but allow the user to re-tick them manually if required.)
It's possible to skip even more pages through use of [Code], but this is rarely necessary.
Another option is that if the installer is being run from your application itself (eg. as part of a "Check for new versions" task) you can use the /SILENT command line parameter to hide the normal interactive UI.

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.

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.

Why does Inno Setup ignore DefaultDirName

Running Inno Setup 5.5.6. I corrected an error in my DefaultDirName value, but no matter what I do, the program continues to try to install in the old, erroneous location. Even when I set it to a value matching one of the examples:
DefaultDirName={pf}\My Program
the program continues to choose the old, incorrect path.
How do I get Inno to use the corrected DefaultDirName?
Even though the previous install went to the wrong destination directory, the install did complete. According to the documentation for DefaultDirName:
If UsePreviousAppDir is yes (the default) and Setup finds a previous
version of the same application is already installed, it will
substitute the default directory name with the directory selected
previously.
So my previous installation was overriding the new DefaultDirName. Once I uninstalled the program and re-ran the installer, it began using my corrected DefaultDirName.
Set the AppendDefaultDirName directive to no, e.g.:
[Setup]
...
AppendDefaultDirName=no
As the reference says (emphasized by me):
By default, when a folder in the dialog displayed by the Browse...
button on the Select Destination Location wizard page is clicked,
Setup automatically appends the last component of DefaultDirName onto
the new path.
For example, if DefaultDirName is {pf}\My Program and "Z:\" is clicked, the new path will become "Z:\My Program".
Setting this directive to no disables the aforementioned behavior. In
addition, it causes a Make New Folder button to appear on the dialog.

How to make a single page installation wizard?

I made a python program and I compiled it using Py2exe and it works great.
As you know, all the big softwares shifted to 1-3 steps install. And many have just one page install in which they include their EULA. I found an example of this:
Image:
How to make just a single page wizard in NSIS ? Is it possible to do a single page installer like shows the above image ?
A NSIS installer is never going to be a one page wizard because the actual installing happens on a 2nd page.
There are probably two ways to create the every detail on one page wizard:
Use Resource Hacker to edit the directory page in one of the NSIS ui's in NSIS\Contrib\UIs to add a richedit control and in the script use ChangeUI to apply this new page then at run-time use one of the license plugins to fill the richedit control.
Create a custom page with nsDialogs.

How to skip the screen for Name/Organization in Inno Script installer

Inno Setup allows you to see a screen in which you are prompted to input your name and Organization.
How I can make my installer skip this screen?
To skip the Name and Organization input in InnoSetup script do the following:
UserInfoPage=no
Source: http://www.jrsoftware.org/ishelp/index.php?topic=setup_userinfopage
For that page to appear, your setup must have explicitly implemented the CheckSerial event function. If you remove that then the page will also disappear.

Resources