>> I don't want to use cmd.exe and do it indirectly. I am sure that there is a >> way to do that in WIX.
Not that I could find ;) Custom actions seem to launch from some folder ... I never bothered trying to figure out which but it seemed to be either system32, %temp% or the folder of the MSI depending on what actions were running at what elevation and if UAC was enabled or not. Your best bet is to update the application to figure out where it is located on disk, and reference files from that location rather than assuming that the "Working Directory" has been correctly set. Alternatively set a registry key during install that your application can reference and use that as a base path. Even if you could set the working directory during install, what happens if a user later tries to launch your application with an incorrect working directory? How would you handle that situation? If you can break it during install, then surely your users will break it later ;) Sascha On Wed, Jan 27, 2010 at 6:36 AM, Baris Taze <bt...@microsoft.com> wrote: > > I wonder how to set working directory of the launching application (setup > launches app after the setup). > Currently I have the following custom action to launch the installed > application. > > <CustomAction > Id="LaunchMyRedPro" > FileKey="MyRedPro.exe" Return="asyncNoWait" > ExeCommand="" Impersonate="yes"/> > > > And it refers to the following file defined in the WIX: > > <File Id="MyRedPro.exe" > Name="MyRedPro.exe" > KeyPath="yes" > Assembly=".net" > AssemblyApplication="MyRedPro.exe" > Source="$(var.MyRedProExePath)" > > > <Shortcut Id="MyRedProProgMenuShortcut" > Advertise="yes" > Icon="MyRedProIcon.exe" > Directory="ProgramMenuDir" > WorkingDirectory="TARGETDIR" > Description="!(loc.ShortcutDesc)" > Name="MyRedPro.lnk" > Show="normal" /> > <netfx:NativeImage Id="MyRedProGenNativeImage" Dependencies="yes"/> > </File> > > My setup installs successfully and it launches the application; however the > working directory of the launched application is being set as the same folder > of the MSI (or maybe System32). I want to run it under the installation > folder (e.g. TARGETDIR) as in Shortcut configuration above. I don't want to > use cmd.exe and do it indirectly. I am sure that there is a way to do that in > WIX. > > Any help on that? > -Baris > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users