Ship file with flatpak - json

I have a json file with some data that I want to ship with my application.
I want to include it on the folder /app/share/<app-name>/data/<file>.json.
I have researched, looked on the flatpak manifest documentation and the manifest of other applications, but I saw no mention to this option.
So, how would be the proper way of adding this file on the manifest?

You can do this by adding this file as part of the "sources" field in your module, and then installing it.
An example of this in the Flathub repo for Spotify. There, we definitely have a need for shipping separate files that make the integration into your DE seamless, as Spotify doesn't ship those. Concretely, let's look at the desktop launch file that is added:
The file can be found here: https://github.com/flathub/com.spotify.Client/blob/master/com.spotify.Client.desktop
You specify the relative path as a "file" source
Add the install command to the build-commands field of your module

Related

how can i host a json file on artifactory, can artifcatory be used as a webserver

I want to host a json file on artifactory repo.
Currently if i go to the link for the file it directly downloads.
But i want it to be shown as a file like a webserver.
Is that possible in artifactory ?
Can it work as a webserver for hosting single files ?
In order to achieve your use case, you need to enable content browsing option in your Artifcatory repository. You can find the details here:
Please be aware this may not work for all the file types(for json it should) as it's based on the mime types configured for the Artifactory application.
You can view any file or artifact from the Artifactory UI (tree browsing) or with native list browsing.
See more information about file browsing here and here.

Recompile CHM file

I'm working on a script that should be able to add additional information to a .chm file.
After decompiling it with hh.exe -decompile outputFolder fileName.chm command, I get the html files, and other 2 files with .hhc and .hhk extension.
After editing the html files, I'd like to recompile the files into a single .chm file. I read that that I also need a .hhp file in order to do that, but that's not generated in the decompilation process.
How can I solve this?
This is a problem of Compiled Help Modules (CHM). And yes - you need a *.hhp for compiling again by HTMLHelp Workshop or e.g. FAR HTML.
You know, you can use 7Zip or just open a command prompt window on a Windows PC and type the following:
hh.exe -decompile <target_directory> <path>\<filename>.chm
The only decompiler with any additional features is KeyTools as this can try to rebuild the project (.hhp) file. You'll need this file if you want to recompile the help project.
One thing to note is that the decompile/recompile process isn't a "round-trip" process. Certain features that the help author added to the original help file can't be recovered when you decompile it, so these may no longer work properly after you've recompiled.
This is especially true in the area of context-sensitive help, which may be broken in the new version of the file.
It can be useful, to include the .hhp file itself - after regenerating is done - into the section [FILES] of the project file (.HHP). Thus, this is included in the Compiled Help Module (CHM) when compiling. The appropriate *.HHP file then is decompiled in addition to the other files for future use.

Selenium ide to locate a file and store its path info from any computer

currently in my test scripts for automated file upload to browser, the paths are already defined in the value column
command type
target //input[#type='file']
value /Users/.../.../.../filename.extension
in such cases, this script is unable to run on other computers because the path would be different.
my question will be is
is there a way to locate the file in a general folder (for example file is downloaded and in the "download" folder), by using selenium ide can we get the path of the file (/Users/.../downloads/filename.extension)
store the path of the file with its extension into a notepad which i will be using it for multiple test of file uploads later on.
right now if my colleague needs to run the script from his computer, he have to manually change the value to his path.
You could use a suite file that contains a "setup" file to only change the file name in 1 place and the variable is shared across tests in the suite. You could also select an agreed up on place to store the files: c:\test_info\image.jpg.
Or you can make the file available by URL & not local, Unfortunately javascript prevents that for security: How to get the current file path in javascript
Unfortunately I can't think of any other good way unless you all have the same path in a home directory and could do something like ~/test_dir/photo.jpg

Chrome Extension manifest.json difference

I'm trying to create zip package for my chrome extension for chome webstore, and having difficulties to determine what kind manifest.json format that requires in the zip package.
my first attempt was to copy the manifest.json that in my extension (compiled to .crx file) into the zip package, so the content of zip package
manifest.json
myextension.crx
but this approach leads to a problem where background script cannot be loaded when try to install the extension in chrome.
my second attempt was to strip the manifest json and only leave some fields such name, description, and icon. It seems my second attempt was successful, as my extension can be installed.
Is my approach was correct? please advise.
The correct format of the manifest file is documented here. That having said, I suspect that the issue has nothing to do with your manifest file, but the structure of your zip file. When submitting a zip file, make sure that you zip the directory's content, not the directory itself.
E.g. the following structure is OK:
manifest.json
background.js
...
The following is not OK:
extension/manifest.json
extension/background.js
You've probably created the following situation, which is not OK, because it declares the background script as "background.js", while it's actually located at "extension/background.js":
manifest.js containing "background": {"scripts": ["background.js"] }
extension/background.js
Your second attempt probably worked because you had zipped the file in the correct way.
Actually you should upload a ZIP archive that contains just the root directory of your extension (nothing should be CRXed). According to the "Get Started" guide:
Create a ZIP archive of the directory that contains manifest.json and the icon. On Windows, you can do this by right-clicking myapp and choosing the menu item Send to > Compressed (zipped) folder. On Mac OS X, control-click myapp and choose Compress "myapp".
If you like to use the command line, you might enter this:
zip -r myapp.zip myapp
Note: The ZIP archive should not contain just the contents of the extension's root directory, but the root directory itself (with all its content, of course).
(BTW, I have no idea why your second attempt worked - according to the docs it shouldn't.)
UPDATE:
After trying it out myself, both approaches seem to work.
Bottom line, upload a ZIP archive with the content of your extension and not any CRXed stuff. Google will produce the CRX itself.

How do I get the current filename of an AIR app?

I'm building an AIR app where some functionality depends on renaming the app executable in the filesystem, and detecting whatever name the executable has when it's launched. I don't need to detect changes while the app is running, if that makes any difference, and I don't need the path or extension — just the name.
If the executable was the only item in its folder, I could get the Application Directory from the File class and go from there. But it would be ideal to have a solution where there may be more than one copy of this AIR executable in a folder, each renamed to something unique.
I've looked at the NativeApplication class, the System class, the File class, and any other class that seems related to this issue, to no avail. The closest I've come is getting the Filename from the Application Descriptor XML, but that only reflects the default name the application is given when published.
So, how I can get the exact current filename of an AIR app at launch?
EDIT: To be more specific, on a Mac this executable would be the .app file, and on Windows this would be the .exe file.
EDIT2: loaderInfo.url won't work — it gives the name of the SWF file running within the AIR app, not the name of the containing AIR app/exe. If you're on a Mac, you can see this SWF file by opening the package contents of the AIR app, and looking in the Resources folder.
Use the following process:
Use the class XSLTProcessor, with HTMLLoader if necessary
Create an XSLT stylesheet which applied to the <filename> element
Apply it to the application descriptor file