Avoid creating installation directory for patch installation - install4j

Today I need a solution to avoid creating a installation directory by install4j version 6.1.3 in a context of a patch installation. I wrote an installer which contains some files to install them to an existing application installation. The files should be bundled together with the patch installer. At the install files action i deactivated the install runtime selection point but the installer still created the installation directory containing a folder called .install4j. In this folder there are only some install4j files. When I deactivate the whole install files action the folder will not be created but the bundles files will also be not extracted to the temp-dircetory, right? I also marked the installation directory as an excluded file at the media-wizard. Do I missed something?
Thanks in advance

I would recommend to use the "Add-on installer" installer type on the "Installer->Update options" step.
If you need to update the version number, an alternative solution would be to remove the "Install files" action and add a ZIP file files.zip on the "Installer->Custom Code & resources" step that contains the new files. In the "Installation" screen, add an "Install content of a ZIP file" action with the "Zip file" property set to ${installer:sys.resourceDir}/files.zip.

Related

How to replace myproduct.exe with renamed eclipsec.exe

I have an Eclipse RCP product.
I am (ab?)using the p2.inf file, located in the directory the .product file is located in, to remove the .exe file and rename the eclipsec.exe file to the .exe file. The content looks as follows:
instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/eclipsec.exe, target:${installFolder}/myproductname.exe, overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/eclipsec.exe);
I need to build this product for windows and linux with maven tycho. For windows the p2.inf file instructions work fine. For linux this fails, which I am not surprised about (there is no .exe file).
Is there a way to execute those instructions for windows only / ignore the p2.inf file for linux builds when the product is built with tycho (for linux just 1 executable is generated anyway)?
Thanks in advance.
Tycho version: 1.0.0
Eclipse SDK version: 4.7.0
This can be done either:
with a fragment that contains the p2.inf file and that has the Platform Filter: (osgi.os=linux) or
by defining an installation unit (IU) similar to the example described here that contains a line like units.0.filter=(osgi.os=linux). (see also Customizing Metadata in Eclipse help and in the Eclipse wiki)
If possible, the first option is preferable, since the second option is more complex and requires more knowledge about p2.
Note, your root problem seems to be Eclipse bug 185205. Maybe you'd like to vote for it or comment on it. I suspect there is a better workaround than do a copy via p2 for that.
I have to solve it myself, posting complete solution here using windows filter.
Create file p2.inf in the "Product" project of your application
(or feature project).
Change MYPRODUCT to your own branding name.
When copying make sure there are no trailing spaces after backslashes in touchpoint actions or it won't work.
#create a requirement on the fragment we are creating
requires.22.namespace=org.eclipse.equinox.p2.iu
requires.22.name=MYPRODUCT.eclipsecoverride.config.win32.win32.x86_64
requires.22.range=[$version$,$version$]
requires.22.greedy=true
requires.22.filter=(osgi.os=win32)
#create a IU fragment with touchpoint action
units.0.id = MYPRODUCT.eclipsecoverride.config.win32.win32.x86_64
units.0.version = $version$
units.0.provides.1.namespace=org.eclipse.equinox.p2.iu
units.0.provides.1.name=MYPRODUCT.eclipsecoverride.config.win32.win32.x86_64
units.0.provides.1.version=$version$
units.0.filter=(osgi.os=win32)
units.0.instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.copy(\
source:${installFolder}/eclipsec.exe,\
target:${installFolder}/MYPRODUCT_console.exe,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.remove(\
path:${installFolder}/eclipsec.exe);
How I moved eclipsec.exe to myproduct.exe (overwritten) without destroying the linux build
I added a myproduct.p2.inf file next to my myproduct.product file with the following content:
instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/eclipsec.exe, target:${installFolder}/myproduct.exe, overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/eclipsec.exe);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../../linux/gtk/x86_64/myproduct/myproduct.exe);
With this state the copy instruction will fail for Linux builds because there is no eclipsec.exe file (FileNotFoundException). It's generated for Windows builds only.
Note that the copy instruction fails if specified files are not found while the remove instruction simply isn't executed in case the specified file does not exist.
Workaround
To work around this problem I added the empty file org.example.feature/filesToCopy/eclipsec.exe to my feature (which is included in my feature based product) and added the line root.linux.gtk.x86_64=filesToCopy to the build.properties of the feature project. This copies the empty eclipsec.exe file to the Linux build.
What happens for Windows:
The product is built with eclipsec.exe and myproduct.exe
eclipsec.exe is copied to myproduct.exe (which overrides myproduct.exe)
eclipsec.exe is deleted
--> myproduct.exe is the only executable (next to the myproduct.ini file). All brandings are lost though!
What happens for Linux:
The product is built with the myproduct executable and an empty eclipsec.exe file.
eclipsec.exe is copied to myproduct.exe
eclipsec.exe is deleted
myproduct.exe is deleted too
--> The linux archive looks exactly as it was built by tycho. All the copying and renaming of *.exe files have no other purpose than making it possible to execute the copy instruction in the p2.inf file which is required for the Windows build.

How to view Plugin Manager in Notepad++

I downloaded Notepad++ from https://notepad-plus-plus.org/repository/7.x/7.5.1/npp.7.5.1.Installer.x64.exe.
And I installed the same. Now I need to install few plugins, but in the menu option Plugins there are only Converter and MIME tools listed, but not Plugin Manager.
Edit: They have removed Plugin Manager with the version 7.5. Still it can be added by following #johnny 's instruction in the best solution.
P.S: The plugin manager is only supporting the 32-bit version.
As of Notepad++ version 7.5, plugin manager is no longer shipped with Notepad++
From the Notepad++ release notes:
You may notice that Plugin Manager plugin has been removed from the official distribution. The reason is Plugin Manager contains the advertising in its dialog. I hate Ads in applications, and I ensure you that there was no, and there will never be Ads in Notepad++.
A built-in Plugin Manager is in progress, and I will do my best to ship it with Notepad++ ASAP.
If the above doesn't put you off, and you want to proceed and install the plugin manager anyway, it looks like there's a GitHub repository for nppPluginManager - though I haven't personally used it, so cannot comment on it's validity.
The nppPluginManager installation instructions state:
To install the plugin manager, simply download (links below) the .zip, and place the PluginManager.dll file in the Notepad++ plugins directory, and the gpup.exe in the updater directory under your Notepad++ program directory. (e.g. "C:\Program Files\Notepad++\updater")
In fact, if you prefer, you can just add the PluginManager.dll to the plugins directory, then do a reinstall of Plugin Manager from the plugin itself, which will place the file in the right place! Of course, if you're already using an earlier version of the plugin manager, you'll be able to just update from the update tab (or when you get the notification that the update has happened).
The GitHub repository also contains the latest release.
Follow the steps given below:
Download Plugin Manager from here.
You can find the most updated version in the release section in the Git repository:
Extract the contents of zip file under "C:\Program Files\Notepad++"
Restart Notepad++
That's it !!
To install a plugin without Plugin Manager:
Download your plugin and extract contents in a folder. You will find a .dll file inside. Copy it.
Open C:\Program Files (x86)\Notepad++\pluginsand paste the .dll
Run Notepad++
You can download the latest Plugin Manager version PluginManager_latest_version_x64.zip.
Unzip the file.
Copy
PluginManager_latest_version_x64.zip\updater\gpup.exe
into
path-to-installed-notepad\notepad++\updater\
Copy
PluginManager_latest_version_x64.zip\plugins\PluginManager.dll
into
path-to-installed-notepad\notepad++\plugins\
Start or restart Notepad++.
Enjoy!
The way to install plugins seems to have changed, the previous answers here did not work for me.
The current (checked with 7.8.1) way to install plugins is to install it in a sub folder:
The plugin (in the DLL form) should be placed in the plugins subfolder of the Notepad++ Install Folder, under the subfolder with the same name of plugin binary name without file extension. For example, if the plugin you want to install named myAwesomePlugin.dll, you should install it with the following path: %PROGRAMFILES(x86)%\Notepad++\plugins\myAwesomePlugin\myAwesomePlugin.dll
from https://npp-user-manual.org/docs/plugins/
So PluginManager.dll goes into PluginManager sub folder.
Notepad v7.6 includes a Plugin Admin and from this you can install Plugin Manager(note1) but it doesn't work fine with npp v7.6(note2)
On the other hand Plugin Admin is only available on NPP "Setup version" and after following conditions
on Custom installation, "Plugin Admin" checkbox is enabled
on Choose Components "Don't use %APPDATA%" checkbox is disabled
Plugin Admin will place plugins at C:\ProgramData\Notepad++\plugins
(note1)Installation from Plugin Admin is not complete and \updater\gpup.exe is missing
(note2) Plugin manager is not using new plugins path and folder structure; from version 7.6 npp Plugins will be stored in individual folders (having same name than file.dll)
If you want to use npp7.6 portable, you can copy updater folder from Setup version, copy plugins from Setup version, or copy Plugins from npp v<7.6 and place each one in a individual folder.
Latest version of Notepad++ got a new built-in plugin manager which works nicely.
My system was 32 bit. I removed and re-installed Notepad++. After that from below got PluginManager_v1.4.12_UNI.zip and extracted it.
https://github.com/bruderstein/nppPluginManager/releases
I created a folder called PluginManager at C:\Program Files (x86)\Notepad++\plugins\ and copied PluginManager.dll into it. I restarted my notepad++ and now I see Plugin Manager.
A direct process to install / configure Plugin Manager :
Download the latest version of NotepadPlus Plugin Manager from the
official Github handle.
Extract the zip file.
Copy the pluginmanager.dll file and paste in C:\Program Files\Notepad++\Plugins\PluginManager directory.
Restart the Notepad++
Note: Create the
PluginManager directory if it is not present.
Notepad++ v8.1.2 has it where it used to be
I changed the plugin folder name. Restart Notepad ++
It works now, a
It can be installed with one command for N++ installer version:
choco install notepadplusplus-nppPluginManager

How to use Install4j installer for upgrade on non-install4j installation?

How can I upgrade my application with install4j of previously installed application which was build with non-install4j.
There is no direct support for that in install4j, but before the "Install files" action, you can copy files that should be preserved from the old installation directory to a temporary directory. Then you delete the old installation directory with a "Delete files or directories" action.
After the "Install files" action you use the "Move files or directories" action to move the preserved files back to the new installation.

Read a file in the external distribution before installing the files in install4j

I have a requirement to read a file that is in the external distribution before the "install Files" action is called during the installation. is it possible to read the file during the startup action or extract the file to a temp location and read it before the installation process?
Found the answer, It can be included under Custom Code & Resource files if it needs to be available before the "install files" action has run.

install4j uninstaller does not delete all files

i am generating an installer for a desktop application using install4j 4.0.5 compiled by
j2re1.4.2_08 and running on WindowsXP.The Problem is that The uninstaller does not delete any files unless the files that have been installed by a previous installer.
Example : It install my application into program files folder lets say
"Vodafone". My application further creates some files and folder into "vodafone"
folder. At the time of uninstall it delete every thing whatever create
by setup while files and folder created by my application remains
there in "vodafone" even after restart my machine several time so i need to delete all files inside the installation folder .
I need your support to know how to fix this problem and if there is any workaround i can do to solve this issue.
The uninstaller does not delete all files and folders in the installation folder. Only the following files will be deleted:
Files that are contained in the installer and have an uninstallation policy that leads to uninstallation, such as "Always" or "If created".
Files that were registered with context.registerUninstallFile(...) by the installer
If the installation directory is empty after those files have been deleted, the installation directory will be deleted as well.
If you want to delete other externally created files, use the "Delete files or directories" action instead.