Using S#.Installer to publish user content
Atom Reply
3/13/2021


S#.Installer allows the platform users to publish their own applications, connectors, utilities and other content.

How to publish custom content

  1. First you need to make sure that your account has permission to publish content. If you already have the permission, you will see a "Publishing" tab in the S#.Installer window. If this tab is missing, write us an email at info@stocksharp.com. After the technical support service enables the publishing, the tab should appear.
    image5577.png
  2. Next, you need to create one or more products using the form for creating/editing products in the "Publishing" tab
  3. After the product is created, you need to wait for the product to be approved by the technical support. You can only post content to approved products.
  4. Now you can publish the first version of your product!
  5. If you make changes to your product, S#.Installer allows you to simply publish a new version that will immediately become available to your users.

Creating and editing products
To create a product, go to the "Publishing", "My Products" tab. To create a new product, you need to click the "add" button. Immediately after clicking the button, the product has not yet been created, it will be created only after filling out the form and clicking the "save" button.
Fill out the new product form. Example:
image4807.png
Notes on filling in the fields:

  • "Nuget package id": identifier must be one word consisting of the following valid characters: Latin letters, numbers, underscore, period. The identifier must start with a letter.
  • "icon": select an icon file in SVG format
  • "categories": one or more categories to which the product can be assigned
  • "content type" defines what exactly will be published in this product

    • "source code": to publish one or more projects/solutions (.csproj/.sln) with source code
    • "assembly", "standalone app", "indicator", "the diagram element": to publish a finished library or application built in Visual Studio.
    • "schema", "encrypted schema": to publish schemas for S#.Designer
    • "video": to publish a product containing a video file
    • "other": to publish an arbitrary folder with all content

  • "product access" defines the distribution model of the product

    • "free access": a free product, visible and available to everyone
    • "visible to everyone, available after purchase": a paid product that can be purchased via S#.Installer
    • "visible and available to selected users only": a private product for which its availability to users is determined by the author by manually adding and removing users.

  • "Users with access to the product": only for private products. Defines the list of users who see the product and have access to it.
  • "Product Managers": defines a list of users who will receive special product notifications

Publishing the next version of the product
You can publish new versions of the content for the approved product.
To publish the new version, go to the "Publishing", "Publish" tab. In this tab, you can select a file or folder to publish, specify the version to publish, and start the publishing process.
Notes on choosing content to publish after clicking the "select" button

  • for content types "assembly", "standalone app", "indicator", "the diagram element"

    • you must first build your project in Visual Studio in the Release configuration.
    • .NET SDK 5 must be installed on your computer
    • for the application to be published correctly, your project must link to other libraries/projects using references PackageReference to NuGet packages. In case if you have dependent projects (.csproj) in your project, you have to make sure that all those dependent projects have correct NuGet properties set up in their .csproj files (like package id and version). All those dependent .csproj projects must be published separately.

  • for content type "source code": when publishing a folder with source code, subfolders with the following names will be ignored: "bin", "obj", ".git", ".vs", ".idea". All other files will be included in the published package in their respective subfolders.
  • for the content type "scheme", "encrypted scheme", "video", you need to select only one file to be published
  • for content type "other": a package containing all subfolders and files of the specified directory will be published.
  • when you click the "refresh" button, an automatic search for the latest published version will be performed, and a new version will be generated by incrementing the latest one. Before publication, the new version can be manually edited, but it must be greater than the previous one.
  • by clicking the "publish" button, the new version is published. Immediately after that, the current version will be automatically searched for and the newly published version will appear in the current version field. Successful completion means the new version has been published!

image830.png
Licensing support in user products
When you create products of the types "assembly", "standalone app", "indicator", "the diagram element", it is possible to add support for product licensing.
To do this, in the source code of the product, you need to use the license check in the following format:
Код

var msg = "StockSharp.Community.u123456.AwesomeApp1".ValidateLicense();
if (!msg.IsEmpty())
    throw new InvalidOperationException("product license is not valid: " + msg);

To support license checking, you need to add reference to the StockSharp.Licensing library into your project.
In this case, the name of the licensed component is used as "StockSharp.Community.u123456.AwesomeApp1" as an example.
For your application, you need to replace this string with the Nuget package id that was generated when the product was created (see the "nuget package id" field in the product creation form)
This license verification code can only be used for paid products (the value of the "product access" field: "visible to everyone, available after purchase"), since the license is renewed only when the customer purchases the product.

Tags:


Thanks:




0 Answers


Attach files by dragging & dropping, , or pasting from the clipboard.

loading
clippy