I assume that you start your first app is starting your second app with
NativeProcess:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeProcess.html

When you start the process, you pass in an NativeProcessStartupInfo object:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeProcessStartupInfo.html

The NativeProcessStartupInfo has a workingDirectory property:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeProcessStartupInfo.html#workingDirectory

- Josh

On Wed, Jan 18, 2017 at 2:27 PM, Kyle McKnight <kamck...@gmail.com> wrote:

> Oh sorry, I guess I didn't explain it all. I am using that for my
> application, but my app starts up a 2nd app, and so that won't work for
> that 2nd app. I could have the developer of the 2nd app accept a parameter
> to the path I need, but that's harder to do since he's hard to get ahold
> of. It all works fine in release, but depending on the IDE I use and how
> the IDE starts up adl, it is harder during debugging since I have to do a
> bunch of scripting of a batch to start the adl, and the IDE to start the
> batch rather than using any of the IDEs built-in build methods
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 (M)
>
> On Wed, Jan 18, 2017 at 5:24 PM, Josh Tynjala <joshtynj...@gmail.com>
> wrote:
>
> > You can use File.applicationDirectory to get the main directory of the
> > application. You should be able to resolve your relative path from there.
> >
> > - Josh
> >
> > On Wed, Jan 18, 2017 at 11:21 AM, Kyle McKnight <kamck...@gmail.com>
> > wrote:
> >
> > > I have a Flex/AIR application using flex 4.15 and AIR 20.
> > >
> > > I'm using IntelliJ to build the project.
> > >
> > > I have a run configuration that uses the "flash app" configuration.
> > >
> > > My application starts up a java service and an executable.
> > >
> > > The executable that is started has a relative path coded inside of it
> > that
> > > should lead to a file within some folders that are in the same
> directory
> > as
> > > the executable.
> > >
> > > If I run adl from the commandline in the directory I want as the
> runtime
> > > working directory then it works fine.
> > >
> > > If I start the application using Intellij, then Intellij runs this
> > command
> > > first:
> > >
> > > "<path_to_Intellij_home>\jre\jre\bin\java.exe"
> > > -Dapplication.home=<path_to_flex/air_home> -Dfile.encoding=UTF-8
> > > -Djava.awt.headless=true -Duser.language=en -Duser.region=en -Xmx512m
> > > -classpath <path_to_flex/air_home>/lib/fdb.jar
> > > flex.tools.debugger.cli.DebugCLI -ide
> > >
> > > And then runes the adl command
> > > <path_to_adl>\adl.exe -profile extendedDesktop <path_to_app_xml>
> > > <path_to_root_directory>
> > >
> > > THe problem with this is that then the relative directory that the
> > > executable my app starts up is located at
> > > <path_to_intellij_home>\jre\jre\bin.
> > >
> > > So the executable can't find the needed file.
> > >
> > > The only way I have found around this is to use the flash remote
> debugger
> > > run configuration, have that configuration run another configuration
> that
> > > calls a bat file for me first; the bat file changes directory to the
> > > correct directory and then runes the adl command itself, and this
> > > configuration builds first.
> > >
> > > So the order there is build->call runapp.bat (which runs the adl
> > > command)->start REMOTE debugger. But obviously this stinks to have to
> do.
> > >
> > > So my options are to pass in the path from my app to the executable i'm
> > > starting, or to figure out how to manipulate intellij.
> > >
> > > Anyone run into this or know how I might fix it?
> > >
> > > Kyle McKnight
> > > Senior UI Engineer - Accesso
> > > 602.515.1444 (M)
> > >
> >
>

Reply via email to