Add components at runtime in NSIS uninstaller - nsis

I'm using NSIS to distribute my software. It's basically a plugin to view custom 3d content and is delivered with one content package. Since I'm distributing the contents separately each content package has it's own installer with the same software. The problem is that each time I install additional content, the uninstaller gets overwritten and so the uninstaller only knows about the last installed component.
Would it be possible to write a registry entry for each content and then generate the component list of the uninstaller dynamically?
I'm open for any other advices how this could be achieved.
Best regards,
Satara

They easy way is probably just to give the uninstaller a unique name for each content package and if required, keep a count of installed packages under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDlls so you know when to uninstall the engine/plugin.
The number of NSIS sections is set at compile-time and you can not add more so if the maximum number of packages is unknown you cannot just make some of the sections unchecked & hidden. The way around this is to store a list of the installed packages somewhere in the registry and create a custom page (nsDialogs) in the uninstaller where you list the installed packages...

Related

Sublime Text: disable all packages

I'm using Sublime Text 3083.
When I load a file with several thousand lines and try to edit it, it gets amazingly un-responsive to the point that adding/removing even one character takes it seconds.
I have > 20 packages installed and I need a way to disable all of them at once, to check if this issue is package related or o not.
I've searched around and I know that you can disable packages one by one but that's not good when lots of packages are installed. According to this post in the sublime forum, there is no way to do this but the post is rather old (and also not an official statement)
So, is there a way to do this? Perhaps with a package or a --no-packages flag or some other trick?
BTW: for the sake of completeness, after applying the solution I found that there were two packages responsible for the lag: GitGutter and WordHighlight.
The best thing I can think of is to keep a list of the package names that you can copy and paste into your preferences file in the "ignored packages" section. If you have any sort of linter or code intel that might be the culprit if it's several thousand lines.
"ignored_packages":
[
"SublimeCodeIntel",
"Vintage"
]
Another thing to try would be to just make a copy of your Packages/Users/Package Control.sublime-settings file, then edit the original and delete all the listed packages there and restart ST3. Definitely make that copy first in case it screws up.
Gabriel reports he ultimately solved the issue by copying the list of installed packages out of the Packages/Users/Package Control.sublime-settings file and paste them into the ignored_packages section of his preferences file.
Packages can be simply disabled as follows
Press Ctrl+Shift+P to open Command Palette
Type disable, select Package Control: Disable Package
This will give the list of all the Installed Packages, click on the one which you want to disable.
That's it. And you can enable disabled package anytime, just type enable in step:2.

Inno-Setup not removing entries in Programs and Features

I'm using Inno Setup to build our installer. When I uninstall, the entry created in the "Programs and Features" control panel isn't removed.
We define CurUninstallStepChanged to remove a file and InitializeUninstall to ensure our Install isn't "active" (running). But I didn't think that would cause the entry to remain after an uninstall.
Any ideas?
Thanks,
-Mike
"Programs and Features" values are read from registry.
You need to delete appropriate registry keys to delete your item from this category.
By default Inno Setup generates installer/uninstaller which creates/deletes these keys.
Are you doing something extra in your script which
a) writes additional registry keys?
b) prevents from deleting them?

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.

Inno setup a simple update

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.

Pinned shortcut in MFU (Most Frequency Used) Start menu after NSIS setup

A NSIS created deployment setup, installs two executable. After setup, one of them appears in the MFU (Most Frequency Used) list of the start menu. But I don't that.
Is it possible to remove this link or prevent it during install? I have found this document from Microsoft but is very difficult to code this (my knowable is .NET/C#). Or maybe is it possible with NSIS? All tips are welcome.
You could use WriteRegStr to write the NoStartPage value but it is usually not something you should set explicitly except if this .exe is some kind of generic host program for plugin modules.
Is it possible that you just tested the program on this particular machine so many times that the program ended up on the MFU list?
There is no official API to add things to the MFU list and NSIS does not do anything to try to get the program listed there...

Resources