Solved IFW: there Is no way to get updater's version.
-
I'm using IFW to create my product's installer.
when I tried to display 'updater's version', I could not find the way to retrieve updater's version.
(I need to get updater's version from control script to display it when update task finished)currently, we can get installer's version by using:
installer.value("version");
or
installer.value("ProductVersion");
but these variables always contains installer's version, even if I used the variables above in Component's installer scripts, I always get "Installer's version", not updater's version.
ex:- release version 1.0 installer, users install it.
- release updater version 1.1 on the web (updater site)
- invoke MaintenanceToole(or installer 1.0) on the PC.
- program files are replaced correctly, but control script always displays "updated to version 1.0".
(Components are in updater package, so I can embed updater's version on build time, but I can not pass it to control script)
I tried some tricks like:
I called,
installer.setValue("ProductVersion", "${VERSION}");
in Components installer script.
then tried to retrieve it from control script, but it does not show updater's version.
(I generated Components installer script by using 'envsubst' to replace ${VERSION} with environment variable)or another way I tried but failed, in control script:
Controller.prototype.componentAdded = function (c) { console.log(c.value("ProductVersion")); }; Controller.prototype.updaterComponentsAdded = function(component) { console.log(component.value("ProductVersion")); };
Is there any possible way to get updater's version from controller script?
Qt: version 5.11.x
IFW: version 3.0.3Regards.
-
@kuro
I solved this by myself.
I checked IFW's source code, then I found Components have value "Version"(not "version").
I could receive updater's version like:Controller.prototype.componentAdded = function (c) { console.log(c.value("Version")); }; Controller.prototype.updaterComponentsAdded = function(component) { console.log(component.value("Version")); };
Update of this post:
I forgot to describe.
Need to 'connect' the functions above be called like :function Controller() { installer.componentAdded.connect(this, Controller.prototype.componentAdded); installer.updaterComponentsAdded.connect(this, Controller.prototype.updaterComponentsAdded); }
-
@kuro
I solved this by myself.
I checked IFW's source code, then I found Components have value "Version"(not "version").
I could receive updater's version like:Controller.prototype.componentAdded = function (c) { console.log(c.value("Version")); }; Controller.prototype.updaterComponentsAdded = function(component) { console.log(component.value("Version")); };
Update of this post:
I forgot to describe.
Need to 'connect' the functions above be called like :function Controller() { installer.componentAdded.connect(this, Controller.prototype.componentAdded); installer.updaterComponentsAdded.connect(this, Controller.prototype.updaterComponentsAdded); }