Hello dear Coders, can you share my result for Flex 4.6 and Air 3.1
I hope you because you can work your restarting air applications.
I am sorry because i have been copied completed code but code tags are crazy. I have been edited always. Can you like my example for your nice wqay with Adobe Air Thanks and you are welcome
Have fun! Best regards, Jens
White publishing my build, it says:
"Browser invocation is not supported for this target"
NOTE: I am using air captiveRuntime to build my project instead of regular *.air.
And airappinstaller" is a keyword ? or i can use any namespace ?
I am sorry for late
This is not namespace- i think sure that
"airappinstaller" = default Adobe Air
"airappinstaller-captive" = Adobe Air Captive. I think sure. Thanks!
I Have use that code in my AIR application to restart my application. But, i got some weird issue.
I write that code on refresh button. So, When i restart my AIR application on refresh button click then application restart But, Skin and Image which i embed are not working after restart application.
I don't know why this thing happen.
Is there any solution for that?
Hi my dear sorry for late.. because i am trying with solution. If your embeded images from AS3 Project or Flex Project and they won't work. We need create frist swc ( Library ) like example: [Embed(source="image.png")] public static var myImage:Class; And add library into your project than bitmap or source of image component var img:Image = new Image(); img.source = MyLibraryFromImage.myImage; Don't worry if output sees warnning but it is okay. And restart with adobe air than it works..... :)
Hello @Mitesh Sharma sorry for mistake. For Adobe Air Captive won't work Thanks i am sorry
New improvement with NativeProcress works fine and if you don't worry if your name of application to change like example: "Airname.exe" to "xyz.exe" than restart like File.applicationDirectory.name+".exe" for Windows File.applicationDirectory.name+".app" for Mac OS X
var appFile:String = File.applicationDirectory.name+".exe"; var appNSPI:NativeProcessStartupInfo = new NativeProcessStartupInfo(); appNSPI.executable = new File(appFile); var appNP:NativeProcess = new NativeProcess(); appNP.start(appNSPI); this.close();
Or method with airappinstaller:
var app:WindowedApplication = WindowedApplication(FlexGlobals.topLevelApplication); var mgr:ProductManager = new ProductManager("airappinstaller"); mgr.launch("-launch "+app.nativeApplication.applicationID+" "+app.nativeApplication.publisherID); app.close();
For ANe functions like OS to reboot and to turn of and more
I create soon for Path to C:\Windows\System32
var shutdownFile:String = FileUtils.system32Directory.resolvePath("shutdown.exe").nativePath; var sdNPSI:NativeProcressStartupInfo = new NativeProcressStartupInfo(); sdNPSI.executable = new File(shutdownFile); ... ...
i get the
TypeError: Error #1009: Cannot access a property or method of a null object reference.
message for mgr.launch line....
var app:WindowedApplication = WindowedApplication(FlexGlobals.topLevelApplication);
var mgr:ProductManager = new ProductManager("airappinstaller");
mgr.launch("-launch "+app.nativeApplication.applicationID+" "+app.nativeApplication.publisherID);
please send a sample file... i dont sure our ProductManager class is ok....
Hey @eerku, Sorry for that with Flash Professional - I am not sure. I will try. I don't know you are right because mx and spark are only Flash Builder 4.6 / 4.7 Sorry i can not try that :( I will find solution. Thanks I am sorry for hard coding. I am sure if you want restart function from Air Native Extensions ( ANE ). But it is very simpler than old coding. Thanks!