How can I replace the default Glue42 toolbar with a custom application? - glue42

I found the application APIs, but there is no reference about instructing Glue Desktop to use a custom launcher.

Yes, the toolbar can be replaced with a custom one.
You need to:
Instruct Glue42 Desktop that your application should be considered as a shell and that it should be started automatically
Instruct Glue42 Desktop that it should use a custom launcher
Below are the entries for those.
Add the following to the root level of your application's config (to be placed under %localAppData%\Tick42\GlueDesktop\config\apps\):
{
...
"shell": true,
"autoStart": true,
...
}
And add the following to the %localAppData%\Tick42\GlueDesktop\config\system.json file:
{
...
"useEmbeddedShell": false
...
}

Related

How to set start page in dotnet core web api?

I try to build a web application with dotnet core web api,but i do not know how to set index.html as start page which can be done with dotnet framework web api easily. And i tried to use app.UseDefaultFiles();app.UseStaticFiles(); to solve this problem, however, it did not work.
In Properties/launchSettings.json you can define the launchUrl
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "<your relative URL here>",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
Step 1
app.UseDefaultFiles();
app.UseStaticFiles();
Step 2
Create a folder called "wwwroot". put a file called index.html
Step 3 (optional)
If you are the using the auto generated template, you can remove make the launchUrl blank like this
"launchUrl": "",
Otherwise, you will have to manually keep going to the landing page every time during localhost running.
This is the correct way. But always use UseDefaultFiles() before UseStaticFiles
Otherwise it won't work.
For reference: Core fundamentals of Static Files
If you are using a static file as the default page, the following code can help you.
app.UseDefaultFiles(new DefaultFilesOptions { DefaultFileNames = new
List<string> { "index.html" } });
If you are using the MVC view, just add the routing role.
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}");
});
For Asp.Net Core 2.0/2.1/2.2 just right click on Project → Properties → Debug
and next to Launch Browser checkbox set path to the startup page you want.
Your index.html file must be in the wwwroot folder
wwwroot / index.html
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files
You can set any file in any folder under the wwwroot as defaut file by using options.DefaultFileNames.Add in startup.cs .
For example to use myfile.html in wwwroot/folder1/folder2/ myfile.html, you will add this in Startup.cs
options.DefaultFileNames.Clear();
options.DefaultFileNames.Add("folder1/folder2/ myfile.html");
app.UseDefaultFiles(options);
app.UseStaticFiles();
But some time it may not work. For example
I created project File menu > New > Project , then selected .NET Core > ASP.NET Core Web Application and selected Web Api as project template.
F5 always open page api/values, even though I added index.html in wwwroot folder and added following in startup.cs
DefaultFilesOptions options = new DefaultFilesOptions();
options.DefaultFileNames.Clear();
options.DefaultFileNames.Add("mypage.html");
app.UseDefaultFiles(options);
app.UseStaticFiles();
Then I opened project properties page and deleted the value in Debug/Launch browser box (which was set to api/values)
Now setting of startup page is working and mypage.html is startup page. Note that this page should be in wwwroot folder as you have opted to use static files.
For dotnet core web api 3.1, on launchSettings.json file set "launchUrl": "swagger/index.html",
For Asp.Net Core 2.2 right click on Project → Properties → Debug and next to Launch Browser checkbox set path to the startup page you want.
Project VS
If Index.html is in project root, it will be send by default.

How to use a windows environment variable to hide an API key?

I have a Visual Studio 2015 ASP.NET Core 1.0 project that uses the Google Maps API. Currently, I could hard code the API key in two places:
1) the script tag of a view e.g.
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY_HERE"></script>
2) the config.json file of the project e.g.
{
"Keys": { "GoogleMapsAPIKey": "YOUR_API_KEY_HERE" }
}
Either way the key is exposed when using source control so why not use a Windows Environment Variable?
Within Windows System Properties I added a new environment variable called GoogleMapsAPIKey and pasted in the actual key.
Now how do I use this environment variable in either the script tag or in config.json?
The purpose of the question is to get a general answer on how to use environment variables to hide API keys in such situations.
Add the environment variables configuration provider. Example from here:
public Startup(IHostingEnvironment hostingEnvironment)
{
var builder = new ConfigurationBuilder()
.SetBasePath(hostingEnvironment.ContentRootPath)
.AddJsonFile("config.json")
.AddEnvironmentVariables();
}
If you just want to hide the key during development, you can use user secrets.

Launching an Electron app on Windows restart

So I've built a Windows installer for my Electron app using https://github.com/electron/grunt-electron-installer.
I'm not sure how to launch my app on system start up, like when the user reboots their computer. I suspect it's something I need to do on --squirrel-install but I can't find any documentation on how to do so.
Ideally I would provide a menu option for the user to enable/disable this behaviour.
If you are using electron on Windows/MAC, there is an existing api which you can use to easily auto start your electron APP:
_electron.app.setLoginItemSettings({
openAtLogin: true,
path: _electron.app.getPath('exe')
})
the reference can be found here:
https://electronjs.org/docs/api/app#appsetloginitemsettingssettings-macos-windows
This can be done in a few different ways. The method i used to do this on a windows OS was to use the node winreg module, this allowed me to add a registry key that launched that app on startup. I use this method on a settings window in the application that has some user settings:
function setKeyValue () {
var regKey = new winreg({
hive: winreg.HKCU,
key: '\\Software\\Microsoft\\Windows\\CurrentVersion\\Run'
});
regKey.set('Your_Application_Name', winreg.REG_SZ, '"' + process.execPath + '"', function (err) {
if (!err) {
//notify user?
}
});
I also have the opposite method that removes the reg key regKey.remove if the user disables the app launch on startup.
Alternatively, i have recently seen this node module: auto-launch ,this allows you to set whether the app launches on startup on Mac, Windows and Linux, and therefore might be more useful for you.

Is it possible to configure CKFinder as just a file browser without any upload functionality?

I want to be able to click on the image icon in CKEditor and be able to browser the local file system. I would like the chosen file to be passed to the editor just like the standard URL is. I want to use the base64image plugin to embed the image inline.
I have tried using CKFinder but, when I click the Browse Server button in the Image Properties dialog, I get an empty window with just 'run();' in the centre.
To enable CKFinder in read-only (gallery) mode, set the readOnly configuration option to true and pass it as a configruation option to the CKFinder.setupCKEditor function:
CKFinder.setupCKEditor( editor, {
readOnly: true
} );
This will disable the possibility to modify anything.
If you only want to disable uploads, you can disable modules related to upload operations:
CKFinder.setupCKEditor( editor, {
removeModules: 'FormUpload,Html5Upload,UploadFileButton'
} );
The second thing is to change Access Control settings in the server side connector by setting 'FILE_CREATE' to false so the uploads will be disabled also on the server side.

Chage focus javaw window in TestComplete

I have a java application called App 1.4 () (which I have no access to the code) that, while running up another java application App2 (and a host of other applications). The application App2 is shot from within the App and you can not run your jar. I wonder how do I put App2 in focus and click a button on it.
I did the following code:
setPropertieWithClickOnBoxApp2 function ()
{
  Aliases.Explorer.wndShell_TrayWnd.ReBarWindow32.MSTaskSwWClass.ToolbarWindow32.CheckItem ("App2", true, false);
  Aliases.javaw1.frame01.RootPane.null_layeredPane.null_contentPane.Panel.Panel.Panel.RadioButton.ClickButton();
}
But it is not working.
I solved the problem.
It is necessary to set the next context into the previous context routine code.

Resources