[solved] UpdateEnvironment
Verfasst: 19 Jul 2019, 13:16
I have an issue with reading an environment variable. This happens when installing java-runtime, and a different package with a dependency on java-runtime.
In the java-runtime package an environment variable is set like this:
pdfsam, for instance, is a java application and uses it to create a shortcut:
When pdfsam is installed directly after java-runtime the variable is either not existent or an old value.
So I tried to update the enivornment, with UpdateEnvironment, like is said in the manual:
However, it does not seem to be working. If I change the environment variable to something else, then on a restart (and installation of java-runtime and pdfsam) the pdfsam script still reads the old value.
Of course java-runtime is installed before pdfsam.
In the java-runtime package an environment variable is set like this:
Code: Alles auswählen
openkey [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
set "JAVA_HOME_x64" = "$InstallDir64$\bin"
Code: Alles auswählen
[LinkFolder_install_64]
set_basefolder common_programs
set_subfolder ""
set_link
name: "PDFsam"
target: "$JAVA_HOME_x64$\javaw.exe"
parameters: -Xmx512M -classpath .\lib;.\pdfsam-basic.jar -Dapp.name="pdfsam-basic" -Dprism.text=t2k -Dprism.lcdtext=false -Dapp.home="." -Dbasedir="." org.pdfsam.basic.App
working_dir: "$InstallDir64$"
icon_file: "$InstallDir64$\pdfsam.exe"
icon_index: 0
end_link
So I tried to update the enivornment, with UpdateEnvironment, like is said in the manual:
Code: Alles auswählen
Registry_install_64 /64Bit (here is where the registry gets modified like above)
comment "Reload environment variables"
UpdateEnvironment
Winbatch_Update_Environment /64Bit /RunElevated
[Winbatch_Update_Environment]
"%ScriptPath%\files\nop.exe"
Of course java-runtime is installed before pdfsam.