I'm using Install4j to create an installer for my application, and the uninstaller is generated correctly. However, on Linux, the uninstaller file is not executable and i can't change it even in the properties of the generated uninstaller as you can see in the following image: Picture of the not executable uninstaller
I would like to ensure that the uninstaller is marked as executable during the installation process so that users don't face this problem. How can I achieve this directly from my Install4j configuration or through a script executed during installation?
My current approach attempts to use chmod on the uninstaller, but it doesn't seem to work as expected. Example of what I've tried (in a script):
String uninstallerPath = context.getInstallationDirectory().getAbsolutePath() + File.separator + "uninstall";
if (!System.getProperty("os.name").toLowerCase().contains("win")) {
String[] chmodCommand = {"sh", "-c", "chmod +x \"" + uninstallerPath + "\""};
Process chmodProcess = Runtime.getRuntime().exec(chmodCommand);
chmodProcess.waitFor();
}
Despite this, the uninstaller remains non-executable after installation.
Questions:
Is there a specific configuration in Install4j to ensure the uninstaller is executable on Linux? If not, how can I reliably set the uninstaller as executable via scripting during the installation process?
I'm using Install4j to create an installer for my application, and the uninstaller is generated correctly. However, on Linux, the uninstaller file is not executable and i can't change it even in the properties of the generated uninstaller as you can see in the following image: Picture of the not executable uninstaller
I would like to ensure that the uninstaller is marked as executable during the installation process so that users don't face this problem. How can I achieve this directly from my Install4j configuration or through a script executed during installation?
My current approach attempts to use chmod on the uninstaller, but it doesn't seem to work as expected. Example of what I've tried (in a script):
String uninstallerPath = context.getInstallationDirectory().getAbsolutePath() + File.separator + "uninstall";
if (!System.getProperty("os.name").toLowerCase().contains("win")) {
String[] chmodCommand = {"sh", "-c", "chmod +x \"" + uninstallerPath + "\""};
Process chmodProcess = Runtime.getRuntime().exec(chmodCommand);
chmodProcess.waitFor();
}
Despite this, the uninstaller remains non-executable after installation.
Questions:
Is there a specific configuration in Install4j to ensure the uninstaller is executable on Linux? If not, how can I reliably set the uninstaller as executable via scripting during the installation process?
Share Improve this question asked Feb 4 at 6:46 Vanol NguemoVanol Nguemo 411 silver badge2 bronze badges 1 |1 Answer
Reset to default 1The Unix mode for the uninstaller is defined here:
By default, it is set to 755.
ls -a
on the command line? – Ingo Kegel Commented Feb 4 at 12:17