App Paths: I suppose you can try App Paths
? It is an alternative to updating the PATH variable
. I don't think it works via the command line, but it works in the Windows Shell - or in other words when you do Windows Key + R and type in "YourAppName"
(without the quotes), then you run the right application without updating the systems PATH
variable.
Reminder: Remember to test on all OS versions you intend to support!
Note on WiX:
Sidenote: The WiX toolkit does something interesting. It adds its own environment variable WIX
and sets it to the path of the
toolkit's installation folder. Hence you can do this in scripts and
the cmd.exe
window: "%WIX%bin\candle.exe"
in order to launch the binary in question (candle.exe
, light.exe
, etc...
).
App Paths, Registry: In the registry your App Path
would look something like this:
[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MyApp.exe]
"(Standard)\Your Path Here\Your Path Here\MyApplicationFullName.exe"
Actual reg-file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\DaTool.exe]
@="C:\\Program Files\\My Tools\\DaFullNameOfDaTool.exe"
WiX Markup: Running heat.exe reg MyRegExport.reg -out MyWiXFile.wxs -sfrag -suid
to convert the exported *.reg
file to WiX markup yields something like this (not tested, please adjust as appropriate - just a generalized idea of how to do this):
<Component>
<RegistryKey Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\DaTool.exe" Root="HKLM">
<RegistryValue Value="[ProgramFilesFolder]DaFullNameOfDaTool.exe" Type="string" />
</RegistryKey>
</Component>
Command Line: It seems it works to use the "start" command from a command line window:
start datool
But it does not work to just go datool
. Didn't test much, have a play with it?
Links: