NSIS: Writing to registry (not HKLM) - nsis

Please help me: I want to write some data to registry. You might say "Wait, wait, this is one of the basic features in NSIS!", but, I want to write to the app registry (HKCU, not HKLM). The main purpose is: when the installer installs my product it also installs my update manager. I just want to write the product installation directory to the Updater branch, so it can further fetch the update package and install it to the product directory.

If you have RequestExecutionLevel admin in your script and you are installing to $ProgramFiles then you are doing a machine/all users install and the installer should not write to HKCU. Your application must initialize its entries in HKCU and AppData the first time the user runs it. You cannot do it in the installer because UAC might run the installer as the "wrong" user.
If you have RequestExecutionLevel user in your script then you are doing a single user install and the installer should only write to HKCU and [Local]AppData.

Related

Prevent additional uninstaller uninstall everything

I have an innosetup installer which installs a plugin into the root directory of an application which is also installed with innosetup. After installing my plugin into this dir there are multiple uninst* files:
app/
unins000.exe (the apps uninstaller)
unins000.dat
unins001.exe (another plugin's uninstaller)
unins001.dat
unins002.exe (my plugin's uninstaller)
unins002.dat
Problem is running unins002.exe uninstalls all files in this folder, I need only the files created by my plugin to be uninstalled.
How can I achieve this?
In the [setup] section you need to provide a different (or non-default) AppId value.
When the installer runs and the same the AppId exists for an existing uninstall manifest then Inno will merge them.
Fixed. It was due to a misconfigured UninstallDelete section.

Why my uninstaller is not working properly in nsis?

I have written a nsis script in which i need to prompt the user where there was previous installation and uninstall the previous version if user select the same folder as previous version.It is working fine.But suppose user choose different directory than the uninstall.exe is giving problem.
Ex-suppose user install version 1.2 in folder a and then agian version 1.2 in folder B .
Than in every case the uninstall .exe is pointing to folderb not folder a.How can i solve this issue
In the uninstaller, $instdir is just the directory the uninstaller is in so the uninstaller itself should not care.
You say you are prompting the user, so you already know the location of the old install so all you have to do is to invoke the uninstaller with the special parameter so it knows where to uninstall from...

RCP P2 updates in multi-user environment from read-only installation

I have created an Ubuntu package to install my RCP app. The installed files are owned by root. Is it possible for a user to subsequently install updates through P2? Documentation about Eclipse multi-user installs suggests that it is possible, along with the answer to this question.
However, when I start up the application, it does not automatically check for updates as usual, and the Update Site that I had specified in p2.inf is not listed in the "Install New Software..." dialog.
Using the -configuration or -data runtime options did not help.
I can make it work with a hack by running sudo chown -R <my_username> /opt/<my_app_installation>. When I subsequently launch the application, it does properly check for updates on startup, and my update site is properly listed in the "Install New Software..." dialog. Certainly I would prefer that whatever data it is writing to that installation directory be instead written to the user's home directory.
Supplementary info:
Here is a list of files and folders that showed up in my installation directory only after the directory was given ownership by <my_username> and the program was run.
/opt/<my_app_installation>/configuration/org.eclipse.core.runtime
/opt/<my_app_installation>/configuration/org.eclipse.equinox.app
/opt/<my_app_installation>/configuration/org.eclipse.osgi
/opt/<my_app_installation>/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/1339896994308.profile.gz
/opt/<my_app_installation>/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/org.eclipse.equinox.p2.ui.sdk.prefs
/opt/<my_app_installation>/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/org.eclipse.equinox.p2.ui.sdk.scheduler.prefs
/opt/<my_app_installation>/p2/org.eclipse.equinox.p2.repository
More experimental results:
Even with a writable (chown'd) installation directory, no files are placed there when the
-configuration $HOME/.my_app_files runtime option is supplied.
There are lots of limitation of p2 itself for share install. AFAIK there is no significant improvement in latest release Juno as well.
But a guy from Redhat is working on p2 install with RPM package, you can read his progress in his blog post. The work and idea could be shared with Debian package.

Haskell Installation error

I don't have administrator rights and try to install Haskell on D drive. But at the end of the installation it is showing me an alert box with the following message:
Could not write updated path to HKLM
How to fix this issue? Please help me.
If you're using the Haskell Platform installer for Windows, you should choose the "Portable" install type. In this mode the installer works as a self-extracting archive - it unpacks the files to the specified location and doesn't attempt to update any system settings. Adding an "install only for the current user" option is on my TODO list.
The installation routine tries to edit the registry. It's a good thing this is not possible without administrator privileges.

NSIS Identifying multiple uninstallers

I have multiple instances of a program and each has its own install directory with its own copy of the uninstaller. The installer has a field called "$instance" entered by the user which is recorded in the registry like this:
HKLM "SOFTWARE\#vendor.name#\#product.name# #product.version#\installs\$instance"
which works fine. This key contains the root path of the install.
I would like to uninstall the instance of the program that corresponds to the uninstaller that is executed but the Uninstall section does not retain the variable "$instance" that the user entered at install time.
Any ideas?
Example:
Section Uninstall
; THIS does not display the instance name. :(
MessageBox MB_OK "$instance"
SectionEnd
You can store custom data at the end of the uninstaller.exe without breaking the CRC check, or alternatively store it in a .ini in the same directory as the uninstaller (I do this all the time, just name the ini file "uninstaller.dat" or something like that so users don't mess with it)

Resources