startup

Run application on startup in Windows 8 C#

安稳与你 提交于 2019-12-04 19:38:37
This code: RegistryKey rKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); rKey.DeleteValue(Application.ProductName, false); rKey.SetValue(Application.ProductName, Application.ExecutablePath, RegistryValueKind.String); doesn't work on Windows 8. I don't have idea why because on Windows 7 and on Windows XP this solution works. Can you help me? In order to set something in the registry you need to run the application as an administrator. To do so you first add a Application Manifest File to the Properties "folder" in the project. Then you change

Run Jar file on startup?

邮差的信 提交于 2019-12-04 19:03:22
I have a Java application that lives in the system tray that I compile to a executable jar file. I would like to add the option within my program to add to the system startup items. As I do not know of any uniform way to do this for all operating systems I assumed I would have to write code to do it for each one I intend to support so I started with Windows. When I attempted to add it to the registry at [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] using the code available here I discovered that under Windows 7 and 8 unless I have administrator privileges (by running from

Aurelia starting with params passed by PHP

南笙酒味 提交于 2019-12-04 17:39:24
I need to pas params to Aurelia on start. Depending on values passed the application will have diffrent state. This application is injected on page which is build with PHP, so the best way would be starting it with parameters specified with PHP code. Is there any way to do this? Any data you can access in normal JS you can access with Aurelia. Maybe you could use a data-* attribute to do this? When you use a main file by doing aurelia-app="main", the framework instance you get passed to your configure method has a host property that is the element the framework is being attached to. You could

HAProxy doesn't start, can not bind UNIX socket [/run/haproxy/admin.sock]

狂风中的少年 提交于 2019-12-04 16:47:00
问题 I'm trying to start haproxy (version 1.5.8 2014/10/31) with an "empty" config file and I get: user@server:~$ sudo service haproxy start [....] Starting haproxy: haproxy[ALERT] 126/120540 (7363) : Starting frontend GLOBAL: cannot bind UNIX socket [/run/haproxy/admin.sock] altough it's enabled: user@server:~$ cat /etc/default/haproxy # Set ENABLED to 1 if you want the init script to start haproxy. ENABLED=1 Configuration file: global log /dev/log local0 log /dev/log local1 notice chroot /var

Run shell script after XServer is started?

纵饮孤独 提交于 2019-12-04 16:45:29
How to run shell script when XServer is started and lightdm also. I tried with init.d and rc.local in /etc directory, but my script is calling an gui application so that the reason I need to run it after XServer is started. I am using Debian Jessie. According to this link .xinitrc in your home directory will be read and executed, otherwise the default /etc/X11/xinit/xinitrc is used. So you should be able to create this file and have the shell script started. 来源: https://stackoverflow.com/questions/35633594/run-shell-script-after-xserver-is-started

Tomcat安装及配置教程

守給你的承諾、 提交于 2019-12-04 15:15:47
今天准备学习Spring MVC的时候,发现,Spring MVC的环境搭建要用到Tomcat,于是自己动手下载安装,解决问题。 1.搜索词条tomcat直接进入官网 2.选择左侧菜单栏中DOWNLOAD下面合适的tomcat版本进行下载(如果不知道下载哪个版本可以点击which version,查看与jdk匹配的版本),我下载的是tomcat 9版本。 3.下载的时候自己选择下载路径,路径很重要,因为后面环境变量配置要用到,我选择的是D:/program files/tomcat 4.下载解压完成后,将tomcat的路径复制下来,右键我的电脑——属性——高级——环境变量——系统变量——新建3个变量 三个系统变量的变量名和变量值分别为: CATALINA_BASE tomcat安装路径 CATALINA_HOME tomcat安装路径 CATALINA_TMPDIR tomcat安装路径\temp 5.在path中添加变量值(PATH——编辑——在末尾添加一行即可) 6.打开cmd,输入startup.bat,我的发现报错: 7.在网上搜索方法之后发现,startup.bat会调用setclasspath.bat,而setclasspath里面有信息头JAVA_HOME和JRE_HOME,所以我们手动设置。 注意:startup.bat和setclasspath

System Tray Icon not appearing on startup

醉酒当歌 提交于 2019-12-04 14:34:57
问题 I use the following code in the FormCreate event handler to create a system tray icon. When I run my program the system tray icon appears fine. I set my application be started automatically on windows start up. When I restart the computer my application's process is started but the system tray icon never appears. I think it might be something to do with the timing of when the code is run, that perhaps the system tray isn't ready to be populated. I get my app to run at start up via it's NSIS

Asp.net core 2.0 conditional service or conditional connection string

强颜欢笑 提交于 2019-12-04 13:54:26
I am developing web api(s) using Asp.net core 2.0. Now the thing I need is to use different connection strings which will be specified in the headers of the user. I have previously seen this (not directly about this question): app.Use(async (context, next) => { if (string.IsNullOrWhiteSpace(context.Request.Headers["Authorization"])) { if (context.Request.QueryString.HasValue) { var token = context.Request.QueryString.Value .Split('&') .SingleOrDefault(x => x.Contains("authorization"))?.Split('=')[1]; if (!string.IsNullOrWhiteSpace(token)) { context.Request.Headers.Add("Authorization", new[] {

Run Batch File Before Windows 7 User Login to Start VLC Web Interface

只愿长相守 提交于 2019-12-04 13:18:23
问题 I would like to run a batch file I have that executes the following before a user logs on: start "VLC web Interface" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -I http Currently I have this in my Startup folder but I would like this batch file to be executed before a user is logged in on Windows 7. The goal is to start VideoLAN's Web Interface as a service without requiring a user to login. This way the computer can be turned on, and media can be streamed to my devices without choosing a

How can I write a startup script for Mac OS X?

血红的双手。 提交于 2019-12-04 06:58:43
I have created a jar file in java, and I want to make the application automatically start during system boot up. I found I have to write a shell script for that. What should be that shell script look like? Is there anything else I have to do to make an application automatically start at boot up? Ned Deily The preferred way to launch programs at OS X startup is to create a launchd daemon as explained here . In mac os x you can also just run "open program.jar" (or any folder, '-a' for native applications) and it will open detached from the terminal with any default environment settings that it