简体   繁体   English

我的AIR应用程序每次打开时都显示“允许应用程序检查更新”吗?

[英]My AIR app is showing Allow Application to Check for Updates everytime it's open?

My AIR app is showing Allow Application to Check for Updates everytime it's opened? 我的AIR应用程序每次打开时都显示“允许应用程序检查更新”吗? I'm using the ApplicationUpdater and ApplicationUpdaterUI classes and calling: 我正在使用ApplicationUpdater和ApplicationUpdaterUI类并调用:

updaterUI.initialize(); 

at startup and then on UpdateEvent.INITIALIZED I call: 在启动时,然后在UpdateEvent.INITIALIZED上,我调用:

updaterUI.checkNow();

Is this correct? 这个对吗?

Here is the screen I see: 这是我看到的屏幕:

在此处输入图片说明

BTW I click the "Check for Updates" button and it then says, "No updates available". 顺便说一句,我单击“检查更新”按钮,然后显示“没有可用的更新”。 I would think that on the next time it opens it would check in the background and only pop up a window when an update is available. 我认为下次打开它时,它将在后台检查并且仅在有可用更新时才弹出一个窗口。 This is how it seems to work on other AIR apps. 这似乎可以在其他AIR应用程序上发挥作用。

In ApplicationUpdaterUI set the isCheckForUpdateVisible property to false refer here for more on ApplicationUpdaterUI . 在ApplicationUpdaterUI中,将isCheckForUpdateVisible属性设置为false ,有关ApplicationUpdaterUI的更多信息,请参见此处 (NOTE: A value set using this property overrides the setting in the update configuration file) . (注意:使用此属性设置的值将覆盖更新配置文件中的设置) This will stops the " Check for Update " window from displaying and only shows the update window when there is any update available. 这将停止显示“ 检查更新 ”窗口,并且仅在有可用更新时显示更新窗口。 If you are using configuration file for UpdaterUI then set like this. 如果您将配置文件用于UpdaterUI,则进行如下设置。

<?xml version="1.0" encoding="utf-8"?> 
         <configuration xmlns="http://ns.adobe.com/air/framework/update/configuration/1.0" >
           <url>app:/server/update.xml</url>
           <delay>1</delay>
           <defaultUI>
               <dialog name="checkForUpdate" visible="false" />
               <!-- Other Configs -->
               <dialog name="downloadUpdate" visible="true" />
               <dialog name="downloadProgress" visible="true" />
               <dialog name="installUpdate" visible="true" />    
           </defaultUI>
        </configuration>

I hope this will helps you.... 希望对您有帮助。

When you download the nativeApplicationUpdater framework, it contains two folder: nativeApplicationUpdater and nativeApplicationUpdaterDemo . 当您下载nativeApplicationUpdater框架时,它包含两个文件夹: nativeApplicationUpdaternativeApplicationUpdaterDemo Go dig into the nativeApplicationUpdaterDemo folder to understanding how to use the framework. 深入研究nativeApplicationUpdaterDemo文件夹以了解如何使用框架。

In my case, I don't use the default Updater UI, just the core nativeApplicationUpdater to check when the update is available (via XML file). 就我而言,我不使用默认的Updater UI,而仅使用核心nativeApplicationUpdater来检查何时有可用的更新(通过XML文件)。 If available, download it through APIs and store it into applicationStorageDirectory. 如果可用,请通过API下载并将其存储到applicationStorageDirectory中。 At the next time your application launch, you can prompt the user to update, or install it silently and just show the progress bar. 在下次启动应用程序时,您可以提示用户进行更新或静默安装,仅显示进度栏。

You shouldn't check for update every times your app start, because an user can close and re-open your application many times (Your server will go die). 您不应该在每次启动应用程序时检查更新,因为用户可以关闭并重新打开您的应用程序很多次(您的服务器将死机)。 You can log the last time you've check for update to Application Preference, and if (thisTime - lastTimeCheck) > inactivityDuration, then check for update. 您可以记录上次检查应用程序首选项更新的时间,如果(thisTime-lastTimeCheck)> inactivityDuration,则记录更新。 (I recommend 3 days or a week). (我建议3天或一周)。

You can search more to learn how to install your application silently, as well as install the Adobe Air run-time silently. 您可以搜索更多内容,以了解如何以静默方式安装应用程序以及以静默方式安装Adobe Air运行时。 Simply un-zip the installer, and install the .msi via command line. 只需解压缩安装程序的压缩包,然后通过命令行安装.msi。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM