Upgrade in the fwsupdates.vbs script

master
Daniel Berteaud 8 years ago
parent 3146221180
commit 98aa2bc885
  1. 4
      packages/fwsupdates.xml
  2. 5
      softwares/fwsupdates.vbs
  3. 4
      softwares/offline_upgrade.bat

@ -6,12 +6,11 @@
reboot="false" reboot="false"
priority="95"> priority="95">
<variable name="PKG_VERSION" value="1.13" /> <variable name="PKG_VERSION" value="1.14" />
<check type="registry" condition="equals" path="HKLM\Software\FWS\Updates\ClientVersion" value="%PKG_VERSION%" /> <check type="registry" condition="equals" path="HKLM\Software\FWS\Updates\ClientVersion" value="%PKG_VERSION%" />
<install cmd='%COMSPEC% /C if not exist "%SYSTEMROOT%\system32\GroupPolicy\Machine\Scripts\Shutdown" mkdir "%SYSTEMROOT%\system32\GroupPolicy\Machine\Scripts\Shutdown"' /> <install cmd='%COMSPEC% /C if not exist "%SYSTEMROOT%\system32\GroupPolicy\Machine\Scripts\Shutdown" mkdir "%SYSTEMROOT%\system32\GroupPolicy\Machine\Scripts\Shutdown"' />
<install cmd='%COMSPEC% /C copy /Y "%SOFTWARE%\fwsupdates\fwsupdates.vbs" "%SYSTEMROOT%\system32\GroupPolicy\Machine\Scripts\Shutdown\fwsupdates.upgrade.vbs"' />
<install cmd='%COMSPEC% /C if not exist "%SystemDrive%\FWSUpdates" mkdir "%SystemDrive%\FWSUpdates"' /> <install cmd='%COMSPEC% /C if not exist "%SystemDrive%\FWSUpdates" mkdir "%SystemDrive%\FWSUpdates"' />
<install cmd='%COMSPEC% /C xcopy /I /E /Y "%SOFTWARE%\fwsupdates\FWSUpdates\assets" "%SystemDrive%\FWSUpdates\assets.upgrade"' /> <install cmd='%COMSPEC% /C xcopy /I /E /Y "%SOFTWARE%\fwsupdates\FWSUpdates\assets" "%SystemDrive%\FWSUpdates\assets.upgrade"' />
<install cmd='%COMSPEC% /C xcopy /I /E /Y "%SOFTWARE%\fwsupdates\FWSUpdates\bin" "%SystemDrive%\FWSUpdates\bin.upgrade"' /> <install cmd='%COMSPEC% /C xcopy /I /E /Y "%SOFTWARE%\fwsupdates\FWSUpdates\bin" "%SystemDrive%\FWSUpdates\bin.upgrade"' />
@ -36,7 +35,6 @@
<install cmd='cscript //Nologo "%SOFTWARE%\fwsupdates\create_shortcut.vbs' /> <install cmd='cscript //Nologo "%SOFTWARE%\fwsupdates\create_shortcut.vbs' />
<install cmd='cscript //Nologo "%SOFTWARE%\fwsupdates\localgp.vbs" fwsupdates.vbs false MACHINE' /> <install cmd='cscript //Nologo "%SOFTWARE%\fwsupdates\localgp.vbs" fwsupdates.vbs false MACHINE' />
<install cmd='schtasks.exe /Create /tn "sync_wpkg" /sc hourly /mo 3 /ru "SYSTEM" /tr "%SystemDrive%\FWSUpdates\bin\delayed_sync.bat" /f' /> <install cmd='schtasks.exe /Create /tn "sync_wpkg" /sc hourly /mo 3 /ru "SYSTEM" /tr "%SystemDrive%\FWSUpdates\bin\delayed_sync.bat" /f' />
<install cmd='reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v WPKGUpgrade /t REG_SZ /d "cmd.exe /c \"%SystemDrive%\FWSUpdates\offline_upgrade.bat\"" /f' />
<install cmd='%COMSPEC% /C echo reg add "HKLM\Software\FWS\Updates" /v "ClientVersion" /t REG_SZ /d "%PKG_VERSION%" /f &gt;&gt; %SystemDrive%\FWSUpdates\offline_upgrade.bat' /> <install cmd='%COMSPEC% /C echo reg add "HKLM\Software\FWS\Updates" /v "ClientVersion" /t REG_SZ /d "%PKG_VERSION%" /f &gt;&gt; %SystemDrive%\FWSUpdates\offline_upgrade.bat' />
<install cmd='%COMSPEC% /C echo cscript "%SystemDrive%\FWSUpdates\repository\wpkg.js" /nonotify /upgrade:fwsupdates &gt;&gt; %SystemDrive%\FWSUpdates\offline_upgrade.bat' /> <install cmd='%COMSPEC% /C echo cscript "%SystemDrive%\FWSUpdates\repository\wpkg.js" /nonotify /upgrade:fwsupdates &gt;&gt; %SystemDrive%\FWSUpdates\offline_upgrade.bat' />

@ -1,2 +1,7 @@
Set objShell = CreateObject("Wscript.Shell") Set objShell = CreateObject("Wscript.Shell")
Set fsObject = CreateObject("Scripting.FileSystemObject")
objShell.Run """" & objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") & "\FWSUpdates\bin\on_shutdown.bat" & """", 0, True objShell.Run """" & objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") & "\FWSUpdates\bin\on_shutdown.bat" & """", 0, True
If fsObject.FileExists(objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") & "\FWSUpdates\offline_upgrade.bat") Then
objShell.Run """" & objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") & "\FWSUpdates\offline_upgrade.bat" & """", 0, True
fsObject.DeleteFile(objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") & "\FWSUpdates\offline_upgrade.bat")
End If

@ -15,9 +15,5 @@ IF EXIST "%SystemDrive%\FWSUpdates\lang.upgrade" (
RENAME "%SystemDrive%\FWSUpdates\lang.upgrade" lang RENAME "%SystemDrive%\FWSUpdates\lang.upgrade" lang
) )
IF EXIST "%SystemRoot%\System32\GroupPolicy\Machine\Scripts\Shutdown\wpkg.bat" DEL /F /Q "%SystemRoot%\System32\GroupPolicy\Machine\Scripts\Shutdown\wpkg.bat" IF EXIST "%SystemRoot%\System32\GroupPolicy\Machine\Scripts\Shutdown\wpkg.bat" DEL /F /Q "%SystemRoot%\System32\GroupPolicy\Machine\Scripts\Shutdown\wpkg.bat"
IF EXIST "%SystemRoot%\System32\GroupPolicy\Machine\Scripts\Shutdown\fwsupdates.upgrade.vbs" (
DEL /Q "%SystemRoot%\System32\GroupPolicy\Machine\Scripts\Shutdown\fwsupdates.vbs"
RENAME "%SystemRoot%\System32\GroupPolicy\Machine\Scripts\Shutdown\fwsupdates.upgrade.vbs" fwsupdates.vbs
)
reg delete "HKLM\Software\FWS\Updates" /v PendingChanges /f reg delete "HKLM\Software\FWS\Updates" /v PendingChanges /f
reg delete "HKLM\Software\FWS\Updates" /v PendingChangesList /f reg delete "HKLM\Software\FWS\Updates" /v PendingChangesList /f

Loading…
Cancel
Save