I developed an application in C#.
When I try to run it, the following Windows Smart Screen pop-up show up:
see image
Clicking on "Run Anyway", the program start without problem.
As I need to install this exe on more computer, will be better that the program run without show this pop-up.
Reading on google I figure out that I need a certificate for running the program.
Anyone could help me about how generate a certificate? I don't want to pay for one.
Thanks in advance.
Related
I need to launch MdSched.exe without having to interact with the GUI that gives 2 clickable options. I am working in C# ASP.NET, and I can launch MdSched.exe via cmd, but I need it to immediately choose the restart now and run test option.
Does anyone have any idea how I can accomplish this?
I'm developing a program in mono/C# which will run on a Linux embedded platform with a touch-screen.
I've installed OpenBox in top of Raspbian, because this will run in "kiosk mode" and I'm trying to keep it as simple as possible.
I was planning to have two options in the program:
option to shutdown the computer
option to close the windows manager (openbox) and return to the terminal
For the first option I've tried using:
shutdown
poweroff
systcl poweroff
commands but all require special privileges, so I'm not sure on what would be the best approach. Should I create a bash script with root privileges and run this script from the program?
For the second option, I don't even know how to start. I've configured openbox to be able to close it from the keyboard through Ctrl + Alt + Backspace, but I know how to close it from the program.
I've tried using SendKeys with that key combination but does not work.
I've also tried the solution here using DBUS for C# but I've issues compiling it.
Could you please give any advice?
You can set your sudo program up to let a user run a program without any password.
Add to your visudo file:
<username-or-ALL> ALL=(ALL) NOPASSWD:/sbin/poweroff
See this maybe
If I were you, I would reboot after setting up and before testing.
My Desktop Application is just a single exe file. For reasons that aren't important, I can't use an installer which would add an icon to the Windows 8 Start screen. Can one be added programatically with C#?
Thanks
If you right click on the exe you can click pin-to start
This worked for my example in the image, which is a stand-alone exe without any sort of installation. It will then appear on the start bar.
Hope this helps.
EDIT: I realized after that you said programmatically.
It looks like a link to the start page is put in C:\Users[UserName]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
So perhaps you could tell it to deposit a short cut there?
EDIT 2 this previous question may also be helpful: Creating application shortcut in a directory. It is in C#
Take a look at the code samples for enabling desktop notifications, a prerequisite of which is the existence of a shortcut installed to the Start screen. The sample is C++ w/COM, but you should be able to incorporate this small bit into a C# app (or rewrite the sample code in C# directly).
Question:
I need a DragAndDrop solution to download a file on drop in a folder of Windows Explorer for C# & .NET 4.0. It should not be necessary to have the file on the computer. The file will be big enough that the drag-time won't be enough to get the download done. I have found various questions, even accepted answers, but nothing that works. The very closest thing to something working is this demo project:
http://blogs.msdn.com/b/delay/archive/2009/11/16/creating-something-from-nothing-and-knowing-it-developer-friendly-virtual-file-implementation-for-net-refined.aspx
How to implement this code to download a file as part of the action of putting it to the drop place in Windows Explorer?
Web browsers solve this problem every day. Simplifying their model a little, do this:
Make a little program that performs your download given appropriate command line parameters. This little program should pop up a window with a progress bar and a cancel button.
Spawn this second program whenever the user "drops" something. This program will create the target file immediately and start filling it with data. It will maintain appropriate locks on the file until it is done downloading, at which point the "downloader" will exit.
If you're going to keep the "downloader" threads in the originating program, you will need some kind of download manager so that the user can get appropriate feedback on their downloads.
Okay, as Yahia said in the comments it's not possible without a proper shell extension for the different versions of Windows and .NET. You might have luck with the link I posted, but for me it crashes the Explorer and the developer thinks it works fine.
My honest opinion is with only .NET you can only do it with a FileSystemWatcher via copying special .temp-files, watching where they land, doing your task and replacing the .temp files when your task is done. Sad Windows.
I've written a shell extension using EZShellExtensions.net. It works great in my development environment when I'm logged in as me, as well as any other system when logged in as me. For all other users, the copy-hook I've created never appears. I've used NirSoft's RegDLLView to verify that the DLL is registered, but no luck.
What can I check to see why this is occurring?
FYI
I'm happy to send a copy of my code to whomever wants to help out with this. EZShellExtensions.NET has an evaluation period of 30 days.
UPDATE
ProcMon Output when using the vendor's registration tool now available as a CSV/PML file if anyone's interested.
RESOLVE
I wound up adding console output to the dll for debugging. turns out that a timer wasn't kicking off when running as any user but me (no idea why). This has since been fixed.
That indicates that the shell extension got registered in the HKCU\Software hive instead of HKLM\Software. Only the latter hive makes extensions available to all users. This commonly happens because UAC prevents writing to HKLM\Software unless the program that does the writing is elevated.
If this library comes with a dedicated registration program, they usually do, then be sure to run it from an elevated command prompt. Start + All Programs, Accessories folder, right-click the Command Prompt link and click "Run as administrator". Rerun the registration tool.
If you still have trouble then SysInternal's ProcMon tool can show you exactly where stuff gets written. And don't hesitate to use the vendor's support channels.