Closed Bug 1031120 Opened 12 years ago Closed 12 years ago

Self-publishing packaged apps fail to install

Categories

(Firefox OS Graveyard :: General, defect)

x86_64
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: raniere, Unassigned)

References

()

Details

Steps to Reproduce: 1. Select one packaged app from Marketplace 2. Download the manifest, e.g. $ https://marketplace.firefox.com/app/a8412b2c-6f44-4601-9530-89737d7b3055/manifest.webapp 3. Download the packaged app, e.g. $ wget https://marketplace.firefox.com/downloads/file/256669/math-cheat-sheet-1.1.2.zip 4. Edit the manifest $ sed -i 's/https:\/\/marketplace.firefox.com\/downloads\/file\/256669/http:\/\/localhost:8000/' manifest.webapp 5. Create the file index.html following the example at https://developer.mozilla.org/en-US/Marketplace/Options/Self_publishing: <html> <body> <p>Packaged app installation page</p> <script> // This URL must be a full url. var manifestUrl = 'http://localhost:8000/manifest.webapp'; var req = navigator.mozApps.installPackage(manifestUrl); req.onsuccess = function() { alert(this.result.origin); }; req.onerror = function() { alert(this.error.name); }; </script> </body> </html> 6. Start a local server $ python3 -m http.server 7. Open localhost:8000 with Firefox 8. Select "Install" at the app notification 9. Wait the app be installed 10. Take a look at `~/.appname-hash, e.g. $ tree ~/.mathcheatsheet* Actual Results: The app isn't installed: $ tree ~/.mathcheatsheet* /home/raniere/.mathcheatsheet- 7d72c140fde4dd3ed2d30a003530f538 ├── profiles.ini └── tkn0yfot.default └── times.json 1 directory, 2 files **This also happens with devices running Firefox OS and Android devices running Firefox.** Expected Results: The app is installed and could be launch.
Summary: Can't publishing apps myself because the apps won't be installed → Self-publishing packaged apps fail to install
Success var manifestUrl = "http://www.maths-informatique-jeux.com/webapps/mathui-demos/manifest.webapp"; var req = navigator.mozApps.install(manifestUrl); Failure var manifestUrl = "http://www.maths-informatique-jeux.com/webapps/mathui-demos/manifest.webapp"; var req = navigator.mozApps.installPackage(manifestUrl);
Fabrice and Ehsan, what about comment 2?
Flags: needinfo?(fabrice)
Flags: needinfo?(ehsan)
navigator.mozApps.install does not install the packaged zip for me, but seems to treat the URI as a hosted app, which it is not.
I don't think comment 0 is supported, I'm pretty sure that would not pass the signature checking, which would explain comment 2 as well. But Fabrice will know better.
Flags: needinfo?(ehsan)
About comment 0: Ehsan is right, you can't transfer signed apps from a domain to another. Comment 2 is quite similar: The "Success" case works because hosted apps have a default launch path if there is no explicit one in the manifest. The "Failure" case is similar to comment 0. However since you don't need a privileged app, you can just provide an unsigned package and it will be installable from anywhere.
Flags: needinfo?(fabrice)
(In reply to Fabrice Desré [:fabrice] from comment #6) > Comment 2 is quite similar: The "Success" case works because hosted apps > have a default launch path if there is no explicit one in the manifest. The > "Failure" case is similar to comment 0. However since you don't need a > privileged app, you can just provide an unsigned package and it will be > installable from anywhere. So I still do not understand why installPackage(manifestUrl) does not work. AFAIK, I just packaged the unprivileged app www.maths-informatique-jeux.com/webapps/mathui-demos/package.zip without any signature. Or should something be explicitly be indicated in the manifest to claim that an app is unsigned? @Raniere: why did you replace "installPackage" with "install" on the MDN page about self-publishing packaged apps? (as I said in comment 4, this does not help)
Flags: needinfo?(fabrice)
Unsigned packages should install from any site without problem. What is the error you get in the failure handler? Can you put up a test page?
Flags: needinfo?(fabrice)
(In reply to Fabrice Desré [:fabrice] from comment #8) > Unsigned packages should install from any site without problem. What is the > error you get in the failure handler? Can you put up a test page? Well, it's http://www.maths-informatique-jeux.com/webapps/mathui-demos/ I get the alert "success:app://{7b162a21-9f45-42c1-a49c-5c98fe8ac427}" but nothing is installed. Tested on Android and Desktop. I think Raniere tested it on FirefoxOS too.
ok, I know what's going on: you have different values for the "developer" property in your manifests. They must be identical, as well as the app name.
OK, thanks. I've updated the app and that works now. I'll add this info on MDN.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.