|
I have a custom action that runs the application at commit, but it picks the wrong working directory to start the program from. How can I specify the right directory?
In Windows Installer there is no way to specify the working directory for custom actions. But you don't have to depend on the working directory for your application's operation. In win32 you can use GetModuleFileName() to get the path to your EXE file. In Java you can find out the JAR's path with URl url = getClass().getClassLoader().getResource("com/mycomp/myapp/MyClass.class"). Also, in Windows Installer, you can author a registry entry with [TARGETDIR] as value and then read it from your custom action. From Advanced Installer 1.5 you can start the installed application after the installation with a built-in custom action triggered from the UI.
|