Web 应用程序作为服务自动更新,无需启动器

2024-03-13

如果应用程序是没有启动器的 Web 应用程序即服务,install4j 中的自动更新功能是否有效?我尝试了网络资源中提到的许多方法,但没有成功。请帮忙。我正在使用 install4j Windows 版本 6.1.6。

编辑1: @英戈·凯格尔, 我添加了-Dinstall4j.keepLog=true -Dinstall4j.alternativeLogfile=E:/install4j-log/log.txt根据您的建议并得到以下日志。请帮忙。

[INFO] com.install4j.runtime.beans.actions.control.SetVariableAction [ID 630]: Execute action
       Property script: com.install4j.script.I4jScript_Internal_38
       Property variableName: updateDescriptorEntry
       Property failIfNull: true
       Property onlyIfUndefined: false
       Property responseFileVariable: false
       Property rollbackSupported: false
[ERROR] com.install4j.runtime.beans.actions.control.SetVariableAction [ID 630]: Execute action not successful after 4 ms

EDIT 2:以下是执行代码后的日志(exe文件下载后)UpdateChecker.executeScheduledUpdate(Arrays.asList("-q"), false, null);

Logs:

 [INFO] com.install4j.runtime.beans.actions.update.CheckForUpdateAction [ID 629]: Execute action
   Property connectTimeout: 10000
   Property connectionFailureScript: null
   Property readTimeout: 20000
   Property requestHeaders: []
   Property url: http://localhost:8181/astra-downloads/updates.xml
   Property variable: updateDescriptor
   Property acceptAllCertificates: false
   Property askForProxy: true
   Property rollbackSupported: false
   Property showError: true
   Download: http://localhost:8181/astra-downloads/updates.xml to C:\WINDOWS\TEMP\i4jupd4650856858406689282.xml; size: 366 bytes
   Variable changed: updateDescriptor=com.install4j.runtime.installer.config.update.UpdateDescriptorImpl@82c94f[class com.install4j.runtime.installer.config.update.UpdateDescriptorImpl]
   Execute action successful after 44 ms
[INFO] com.install4j.runtime.beans.actions.control.SetVariableAction [ID 630]: Execute action
   Property script: com.install4j.script.I4jScript_Internal_63
   Property variableName: updateDescriptorEntry
   Property failIfNull: true
   Property onlyIfUndefined: false
   Property responseFileVariable: false
   Property rollbackSupported: false
   Branch 1
   3.0.1
   Variable changed: updateDescriptorEntry=UpdateDescriptorEntry [target: 22, file: GreytipAstra_windows_3_0_1.exe][class com.install4j.runtime.installer.config.update.UpdateDescriptorEntryImpl]
   Execute action successful after 4 ms
[INFO] com.install4j.runtime.beans.actions.control.SetVariableAction [ID 632]: Execute action
   Property script: com.install4j.script.I4jScript_Internal_65
   Property variableName: updaterNewVersion
   Property failIfNull: false
   Property onlyIfUndefined: false
   Property responseFileVariable: false
   Property rollbackSupported: false
   Variable changed: updaterNewVersion=3.0.1[class java.lang.String]
   Execute action successful after 0 ms
[INFO] com.install4j.runtime.beans.actions.control.SetVariableAction [ID 633]: Execute action
   Property script: com.install4j.script.I4jScript_Internal_66
   Property variableName: updaterDownloadUrl
   Property failIfNull: false
   Property onlyIfUndefined: false
   Property responseFileVariable: false
   Property rollbackSupported: false
   Variable changed: updaterDownloadUrl=http://localhost:8181/astra-downloads/GreytipAstra_windows_3_0_1.exe[class java.lang.String]
   Execute action successful after 0 ms
[INFO] com.install4j.runtime.beans.actions.control.SetVariableAction [ID 634]: Execute action
   Property script: com.install4j.script.I4jScript_Internal_67
   Property variableName: updaterDownloadFile
   Property failIfNull: false
   Property onlyIfUndefined: false
   Property responseFileVariable: false
   Property rollbackSupported: false
   Variable changed: updaterDownloadFile=C:/Users/Abhishek/Downloads\GreytipAstra_windows_3_0_1.exe[class java.lang.String]
   Execute action successful after 0 ms
[INFO] com.install4j.runtime.beans.actions.net.DownloadFileAction [ID 635]: Execute action
   Property connectTimeout: 10000
   Property connectionFailureScript: null
   Property md5Url: 
   Property readTimeout: 20000
   Property requestHeaders: []
   Property targetFile: C:\Users\Abhishek\Downloads\GreytipAstra_windows_3_0_1.exe
   Property url: http://localhost:8181/astra-downloads/GreytipAstra_windows_3_0_1.exe
   Property acceptAllCertificates: false
   Property askForProxy: true
   Property checkForMd5Sums: false
   Property deleteOnExit: false
   Property dontAskForRetry: false
   Property retryIfInterrupted: true
   Property rollbackSupported: false
   Property showError: true
   Property showFileName: true
   Property showProgress: true
   Download: http://localhost:8181/astra-downloads/GreytipAstra_windows_3_0_1.exe to C:\Users\Abhishek\Downloads\GreytipAstra_windows_3_0_1.exe; size: 43569152 bytes
   Execute action successful after 2640 ms
[INFO] com.install4j.runtime.beans.actions.files.SetModeAction [ID 637]: Execute action
   Property directoryFilter: null
   Property fileFilter: null
   Property fileTarget: everything
   Property files: [C:\Users\Abhishek\Downloads\GreytipAstra_windows_3_0_1.exe]
   Property filesRoot: null
   Property mode: 755
   Property recursive: false
   Property rollbackSupported: true
   Property showFileNames: true
   Property showProgress: false
   Execute action successful after 0 ms
[INFO] com.install4j.runtime.beans.actions.update.ScheduleUpdateAction [ID 638]: Execute action
   Property arguments: []
   Property installerFile: C:\Users\Abhishek\Downloads\GreytipAstra_windows_3_0_1.exe
   Property maxCancelCount: 10
   Property maxTries: 3
   Property version: 3.0.1
   Property rollbackSupported: false
   Execute action successful after 3 ms
[INFO] com.install4j.runtime.beans.screens.StartupScreen [ID 627]: command: move 1 screens, executing actions, checking condition
[INFO] cleaning up
[INFO] Finished

EDIT 3:下面是日志UpdateChecker.executeScheduledUpdate(Arrays.asList("-q","-Dinstall4j.keepLog=true","-Dinstall4j.alternativeLogfile=E:/install4j-log/log2.txt"), false, null);

[INFO] logger started at Fri Sep 15 15:27:01 IST 2017
[INFO] executable name: C:\Users\Abhishek\Downloads\GreytipAstra_windows_3_0_1.exe
[INFO] install4j version: 6.1.6 (build 6459)
[INFO] Properties: 
-- listing properties --
java.runtime.name=Java(TM) SE Runtime Environment
exe4j.moduleName=C:\Users\Abhishek\Downloads\GreytipAs...
sun.boot.library.path=c:\windows\temp\e4j101b.tmp_dir150546...
exe4j.semaphoreName=Local\c:_users_abhishek_downloads_gre...
java.vm.version=24.80-b11
java.vm.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
path.separator=;
exe4j.consoleCodepage=cp0
java.vm.name=Java HotSpot(TM) Client VM
file.encoding.pkg=sun.io
user.script=
user.country=US
sun.os.patch.level=
install4j.exeDir=C:\Users\Abhishek\Downloads\
java.vm.specification.name=Java Virtual Machine Specification
user.dir=C:\WINDOWS\TEMP\e4j101B.tmp_dir150546...
java.runtime.version=1.7.0_80-b15
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=c:\windows\temp\e4j101b.tmp_dir150546...
os.arch=x86
java.io.tmpdir=C:\WINDOWS\TEMP\
line.separator=

java.vm.specification.vendor=Oracle Corporation
user.variant=
exe4j.tempDir=C:\WINDOWS\TEMP\e4j101B.tmp_dir150546...
os.name=Windows NT (unknown)
sun.java2d.noddraw=true
sun.jnu.encoding=Cp1252
java.library.path=C:\WINDOWS\TEMP\e4j101B.tmp_dir150546...
sun.awt.enableExtraMouseButtons=true
java.specification.name=Java Platform API Specification
java.class.version=51.0
sun.management.compiler=HotSpot Client Compiler
install4j.language=en
exe4j.isInstall4j=true
os.version=10.0
install4j.updateStorageDir=C:\WINDOWS\system32\config\systemprof...
user.home=C:\Windows\System32\config\systemprofile
user.timezone=Asia/Calcutta
java.awt.printerjob=sun.awt.windows.WPrinterJob
java.specification.version=1.7
file.encoding=Cp1252
user.name=ABHISHEK-PC$
java.class.path=C:\WINDOWS\TEMP\e4j101B.tmp_dir150546...
java.vm.specification.version=1.7
sun.arch.data.model=32
java.home=c:\windows\temp\e4j101b.tmp_dir150546...
sun.java.command=C:\Users\Abhishek\Downloads\GreytipAs...
exe4j.launchName=C:\Users\Abhishek\DOWNLO~1\GREYTI~1.EXE
java.specification.vendor=Oracle Corporation
user.language=en
awt.toolkit=sun.awt.windows.WToolkit
java.vm.info=mixed mode
exe4j.unextractedPosition=26515602
java.version=1.7.0_80
java.ext.dirs=c:\windows\temp\e4j101b.tmp_dir150546...
sun.boot.class.path=c:\windows\temp\e4j101b.tmp_dir150546...
java.vendor=Oracle Corporation
install4j.appDir=C:\Windows\Temp\
file.separator=\
java.vendor.url.bug=http://bugreport.sun.com/bugreport/
sun.cpu.endian=little
sun.io.unicode.encoding=UnicodeLittle
install4j.alternativeLogfile=E:/install4j-log/log2.txt
install4j.lockFile=C:\WINDOWS\system32\config\systemprof...
install4j.keepLog=true
sun.desktop=windows
sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+m...
[INFO] com.install4j.runtime.beans.actions.misc.RequestPrivilegesAction [ID 304]: Execute action
       Property allRequested: false
       Property failIfNotRootUnix: true
       Property obtainIfAdminMac: false
       Property obtainIfNormalWin: false
       Property obtainIfNormalMac: false
       Property obtainIfAdminWin: true
       Property failIfNotObtainedWin: true
       Property failIfNotObtainedMac: true
       Property rollbackSupported: false
       Execute action successful after 1 ms
[INFO] com.install4j.runtime.beans.screens.StartupScreen [ID 1]: command: move 1 screens, executing actions, checking condition
[INFO] com.install4j.runtime.beans.screens.WelcomeScreen [ID 2]: Show screen
[INFO] checking writable with maximum
[INFO] com.install4j.runtime.beans.screens.WelcomeScreen [ID 2]: thread name AWT-EventQueue-0

EDIT 4:我在应用程序中的代码:

try {
        ApplicationLauncher.launchApplication("626", null, false, new ApplicationLauncher.Callback() {
                public void exited(int exitValue) {
                    //TODO add your code here (not invoked on event dispatch thread)
                    log.debug("******Exited "+exitValue+"********");
                    log.debug("****Inside block UpdateChecker.isUpdateScheduled() "+String.valueOf(UpdateChecker.isUpdateScheduled()));

                    boolean updateScheduled=UpdateChecker.isUpdateScheduled();


                    if(updateScheduled){
                        log.debug("***************Running UpdateChecker.executeScheduledUpdate*******************");
                        UpdateChecker.executeScheduledUpdate(Arrays.asList("-q","-Dinstall4j.keepLog=true","-Dinstall4j.alternativeLogfile=E:/install4j-log/log2.txt"), false, null);
                        log.debug("***************Completed UpdateChecker.executeScheduledUpdate*******************");
                    }
                }

                public void prepareShutdown() {
                    //TODO add your code here (not invoked on event dispatch thread)
                    log.debug("******prepare shut down********");
                }
            }
        );

    } catch (IOException e) {
        e.printStackTrace();
        //TODO handle invocation failure
    }

And the jstack error is as below: enter image description here

EDIT 5:下面是jstack日志:

    2017-09-18 17:31:12
Full thread dump Java HotSpot(TM) Client VM (24.80-b11 mixed mode):

"TimerQueue" daemon prio=6 tid=0x17ecec00 nid=0x3708 waiting on condition [0x1861f000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x03850980> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(Unknown Source)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
    at java.util.concurrent.DelayQueue.take(Unknown Source)
    at javax.swing.TimerQueue.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
    - <0x03884b18> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)

"AWT-EventQueue-0" prio=6 tid=0x17d3f000 nid=0x2670 waiting on condition [0x1841e000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x08ca4218> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(Unknown Source)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
    at java.awt.EventQueue.getNextEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

   Locked ownable synchronizers:
    - None

"AWT-Windows" daemon prio=6 tid=0x17d2fc00 nid=0x40c runnable [0x1838f000]
   java.lang.Thread.State: RUNNABLE
    at sun.awt.windows.WToolkit.eventLoop(Native Method)
    at sun.awt.windows.WToolkit.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
    - None

"AWT-Shutdown" prio=6 tid=0x17d2f400 nid=0xe68 in Object.wait() [0x182ff000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x08c79758> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:503)
    at sun.awt.AWTAutoShutdown.run(Unknown Source)
    - locked <0x08c79758> (a java.lang.Object)
    at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
    - None

"Java2D Disposer" daemon prio=10 tid=0x17d2ec00 nid=0x3d64 in Object.wait() [0x1826f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x08c797e8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    - locked <0x08c797e8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    at sun.java2d.Disposer.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
    - None

"Service Thread" daemon prio=6 tid=0x1783bc00 nid=0x468 runnable [0x00000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"C1 CompilerThread0" daemon prio=10 tid=0x1783a000 nid=0x1768 waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Attach Listener" daemon prio=10 tid=0x17837800 nid=0x389c waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Signal Dispatcher" daemon prio=10 tid=0x17835400 nid=0x3258 runnable [0x00000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Finalizer" daemon prio=8 tid=0x0101a800 nid=0x4394 in Object.wait() [0x033bf000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x08ab74f8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    - locked <0x08ab74f8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

   Locked ownable synchronizers:
    - None

"Reference Handler" daemon prio=10 tid=0x01015800 nid=0x3d50 in Object.wait() [0x0127f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x08ab7588> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:503)
    at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
    - locked <0x08ab7588> (a java.lang.ref.Reference$Lock)

   Locked ownable synchronizers:
    - None

"main" prio=6 tid=0x010ac400 nid=0x3138 in Object.wait() [0x00798000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x038517d0> (a com.install4j.runtime.installer.controller.CommandSink)
    at java.lang.Object.wait(Object.java:503)
    at com.install4j.runtime.installer.controller.Controller.start(Controller.java:87)
    - locked <0x038517d0> (a com.install4j.runtime.installer.controller.CommandSink)
    at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:59)
    at com.install4j.runtime.installer.Installer.main(Installer.java:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:65)
    at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:101)
    at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:26)

   Locked ownable synchronizers:
    - None

"VM Thread" prio=10 tid=0x01012400 nid=0x1bf0 runnable 

"VM Periodic Task Thread" prio=10 tid=0x17856000 nid=0x2fdc waiting on condition 

JNI global references: 449

EDIT 6:下面是日志UpdateChecker.executeScheduledUpdate(Arrays.asList("-q","-Dinstall4j.keepLog=true","-Dinstall4j.alternativeLogfile=E:/install4j-log/log2.txt"), false, null);:

[INFO] logger started at Tue Sep 19 11:20:00 IST 2017
[INFO] executable name: C:\Users\Abhishek\Downloads\GreytipAstra_windows_3_0_1.exe
[INFO] install4j version: 7.0.1 (build 7043)
[INFO] Properties: 
-- listing properties --
java.runtime.name=Java(TM) SE Runtime Environment
exe4j.moduleName=C:\Users\Abhishek\Downloads\GreytipAs...
sun.boot.library.path=c:\windows\temp\e4j554d.tmp_dir150580...
exe4j.semaphoreName=Local\c:_users_abhishek_downloads_gre...
java.vm.version=24.80-b11
java.vm.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
path.separator=;
exe4j.consoleCodepage=cp0
java.vm.name=Java HotSpot(TM) Client VM
file.encoding.pkg=sun.io
user.script=
user.country=US
sun.os.patch.level=
install4j.exeDir=C:\Users\Abhishek\Downloads\
java.vm.specification.name=Java Virtual Machine Specification
user.dir=C:\WINDOWS\TEMP\e4j554D.tmp_dir150580...
java.runtime.version=1.7.0_80-b15
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=c:\windows\temp\e4j554d.tmp_dir150580...
os.arch=x86
java.io.tmpdir=C:\WINDOWS\TEMP\
line.separator=

java.vm.specification.vendor=Oracle Corporation
user.variant=
exe4j.tempDir=C:\WINDOWS\TEMP\e4j554D.tmp_dir150580...
os.name=Windows NT (unknown)
sun.java2d.noddraw=true
sun.jnu.encoding=Cp1252
java.library.path=C:\WINDOWS\TEMP\e4j554D.tmp_dir150580...
sun.awt.enableExtraMouseButtons=true
java.specification.name=Java Platform API Specification
java.class.version=51.0
sun.management.compiler=HotSpot Client Compiler
install4j.language=en
exe4j.isInstall4j=true
os.version=10.0
install4j.updateStorageDir=C:\WINDOWS\system32\config\systemprof...
user.home=C:\Windows\System32\config\systemprofile
user.timezone=Asia/Calcutta
java.awt.printerjob=sun.awt.windows.WPrinterJob
java.specification.version=1.7
file.encoding=Cp1252
user.name=ABHISHEK-PC$
java.class.path=C:\WINDOWS\TEMP\e4j554D.tmp_dir150580...
java.vm.specification.version=1.7
sun.arch.data.model=32
java.home=c:\windows\temp\e4j554d.tmp_dir150580...
sun.java.command=C:\Users\Abhishek\Downloads\GreytipAs...
exe4j.launchName=C:\Users\Abhishek\DOWNLO~1\GREYTI~1.EXE
java.specification.vendor=Oracle Corporation
user.language=en
awt.toolkit=sun.awt.windows.WToolkit
java.vm.info=mixed mode
exe4j.unextractedPosition=25300990
java.version=1.7.0_80
java.ext.dirs=c:\windows\temp\e4j554d.tmp_dir150580...
sun.boot.class.path=c:\windows\temp\e4j554d.tmp_dir150580...
java.vendor=Oracle Corporation
install4j.appDir=C:\Windows\Temp\
file.separator=\
java.vendor.url.bug=http://bugreport.sun.com/bugreport/
sun.cpu.endian=little
sun.io.unicode.encoding=UnicodeLittle
install4j.alternativeLogfile=E:/install4j-log/log2.txt
install4j.lockFile=C:\WINDOWS\system32\config\systemprof...
install4j.keepLog=true
sun.desktop=windows
sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+m...
[INFO] com.install4j.runtime.beans.actions.misc.RequestPrivilegesAction [ID 304]: Execute action
       Property allRequested: false
       Property failIfNotObtainedMac: true
       Property failIfNotObtainedWin: true
       Property failIfNotRootUnix: true
       Property obtainIfAdminMac: false
       Property obtainIfAdminWin: true
       Property obtainIfNormalMac: false
       Property obtainIfNormalWin: false
       Property rollbackSupported: false
       Property updateInstallationDirectory: true
       Execute action successful after 1 ms
[INFO] com.install4j.runtime.beans.screens.StartupScreen [ID 1]: command: move 1 screens, executing actions, checking condition
[INFO] com.install4j.runtime.beans.screens.WelcomeScreen [ID 2]: Show screen
[INFO] checking writable with maximum

我建议更新到 install4j 7,它有很多新的自动更新功能,非常适合服务。

使用 install4j 7,您可以在安装程序 -> 屏幕和操作步骤中添加“后台更新下载程序”应用程序。该应用程序模板中的关键操作是“安排更新安装”操作。

在您的服务中,您可以像这样启动更新下载器:

ApplicationLauncher.launchApplication("<ID>", null, true, null);

在它自己的线程中<ID>替换为应用程序的 ID。此调用会被阻止,当它返回时,更新安装程序可能已被下载。您可以使用以下命令检查此情况

UpdateChecker.isUpdateScheduled()

现在您只需触发下载的安装程序的执行即可。您可以立即执行此操作,如果您不想终止服务,也可以在启动时执行此操作。您需要的代码片段是这样的:

UpdateChecker.executeScheduledUpdate(Arrays.asList("-q"), false, null);

作为更新安装的一部分,服务将关闭。服务无法自动重新启动(如果您通过了 GUI 启动器可以执行的操作)true作为上述方法调用的第二个参数),但必须通过“启动服务”操作来启动,您的安装程序中可能已经有该操作。

有关更多信息和屏幕截图,请参阅

https://www.ej-technologies.com/products/install4j/whatsnew7.html https://www.ej-technologies.com/products/install4j/whatsnew7.html

并搜索“后台自动更新”。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Web 应用程序作为服务自动更新,无需启动器 的相关文章

  • 如何删除已删除的 git 子树文件夹的历史记录?

    我使用 git subtree 添加了一个 git 存储库 问题是我硬重置回使用 git subtree 添加存储库之前 现在提交历史记录仍在存储库中 但已与主服务器断开连接 知道如何删除它吗 我尝试了 git rm cached 但没有成
  • 跨多个表维护 Identity 值

    我们遇到的情况是 多个表中有一个名为 Customer Number 的列 该列是所有表中的标识列 但是有没有办法可以使该列在所有表中唯一 例如 如果我在 table one 中添加一行 并且标识列为其分配值 1 现在如果有人在 table
  • 从.ajax()调用加载knockout.js observableArray()

    这让我很困惑 这一定是我没看到的小事 我正在尝试加载一个非常简单的observableArray通过 ajax 调用进行淘汰赛 javascript we bind the array to the view model property
  • 抑制命令行输出

    我有一个像这样的简单批处理文件 echo off taskkill im test exe f gt nul pause 如果 test exe 未运行 我会收到以下消息 ERROR The process test exe not fou
  • 静态主类 - AS3

    有没有一种方法可以使主类 基于主 fla 的类 静态 所以我们可以像在java中一样使用它 能够从其他类引用它 因为我必须将main本身的实例作为参数传递给一个类 否则我会失去引用 我尝试添加静态前缀 但似乎 as3 不允许 AS3中没有静
  • 生成随机数一次

    我需要创建一组 0 到 800 之间的随机数 问题是目前我需要快速执行此操作 并且每个数字仅返回一次 我目前的做法是 创建一个std vector包含从 0 到 800 的数字 使用选择一个号码numberVector rand numbe
  • 如何正确读取 Flux 并将其转换为单个 inputStream

    我在用着WebClient和定制BodyExtractor我的 spring boot 应用程序的类 WebClient webLCient WebClient create webClient get uri url params acc
  • Blazor WebAssembly Visual Studio 调试器问题

    我创建了一个干净的 Blazor PWA 项目 当我尝试使用调试器运行它时 不到一半的时间它无法正确启动 一半的时间实际上会有所改善 如果尝试使用调试器 F5 或调试 开始调试 启动 则会打开一个新的浏览器窗口 其中 URL 为 about
  • 适用于 Swift 5 和 Facebook SDK 5 的 Facebook GraphRequest

    我最近更新了我的所有pods和快速的语言Swift 5在我的项目中 收到了大量错误消息 我已经慢慢解决了这些消息 然而 我在 Facebook 上遇到了困难GraphRequest之前工作正常 特别是此错误消息位于version的参数Gra
  • 如何将 Log4J2 复合配置与 Spring Boot 结合使用

    我使用 Spring Boot 2 0 1 starter 和 log4j2 使用以下 POM WAR 文件托管在 Tomcat 8 中 而不是使用嵌入式 tomcat 应用程序日志写入控制台而不是写入日志文件 显然 Spring Boot
  • javascript 中的 location.search 是什么

    我想知道什么location search substring 1 事实上确实如此 我在某个网站上看到了这段代码 我尝试使用打印alert 但这并没有给出任何结果 它应该提醒 location href 吗 alert location s
  • 使用 Xamarin 项目中的 netstandard13 包

    我正在尝试使 Npgsql NET 的 PostgreSQL 提供程序 可供 Xamarin 用户使用 Npgsql已经支持 NET Platform Standard 版本3 并且该标准的文档包含以下句子 如果库面向 NET Platfo

随机推荐