executable

How to start a process in the same folder as its executable

半城伤御伤魂 提交于 2019-12-01 03:28:06
I'm trying to start an application programatically, but it always runs it in the folder of my application... For example: If my app is located in C:\MyApp\myapp.exe and the other app is in C:\OtherApp\otherapp.exe, how can I start the other app in the folder in which it resides, rather than in the folder where my app resides? Here is how I start the other app: private void StartApp(OtherApp application) { Process process = new Process(); process.StartInfo.FileName = application.FileName; process.StartInfo.Arguments = application.AppName; process.Start(); } I guess you mean ProcessStartInfo

Directly call globally installed Node.js modules

五迷三道 提交于 2019-12-01 03:23:15
问题 Supposed I want to write a module for Node.js that shall be installed globally. I do not want to write any C++ (or something else), but plain Node.js code. Basically, this is very easy. Just write the module, and install it using npm install -g . Now, most globally installed modules provide the possibility to call them directly, e.g. you can type express at your command prompt and run the globally installed application bootstrapper of Express. Now my question is: How do I achieve this? If I

How to allocate an executable page in a Linux kernel module?

谁说胖子不能爱 提交于 2019-12-01 01:00:47
问题 I'm writing a Linux kernel module, and I'd like to allocate an executable page. Plain kmalloc returns a pointer within a non-executable page, and I get a kernel panic when executing code there. It has to work on Ubuntu Karmic x86, 2.6.31-20-generic-pae. 回答1: #include <linux/vmalloc.h> #include <asm/pgtype_types.h> ... char *p = __vmalloc(byte_size, GFP_KERNEL, PAGE_KERNEL_EXEC); ... if (p != NULL) vfree(p); 回答2: /** * vmalloc_exec - allocate virtually contiguous, executable memory * @size:

using C# Process to run a Executable program

我的梦境 提交于 2019-12-01 00:51:29
I am a Bioinformatic person and I use C# for my work. I have been using Processes in C# to run Executable programs several times. This time I have a new issue. I have downloaded an exe file in Windows for a program named Blast( http://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=BlastDocs&DOC_TYPE=Download ). If I type in my command which is : blastp -query input.txt -db pdbaa -out output.txt it works fine. But when I copy paste the command from a notepad it will give an error. I searched for the problem and I found that it is an "encoding problem UTF-8 versus ISO-latin" ( http://biostar

Store files in C# EXE file

爷,独闯天下 提交于 2019-12-01 00:39:24
It is actually useful for me to store some files in EXE to copy to selected location. I'm generating HTML and JS files and need to copy some CSS, JS and GIFs. Snippet System.IO.File.WriteAllBytes(@"C:\MyFile.bin", ProjectNamespace.Properties.Resources.MyFile); doesn't work for me! On "WriteAllBytes" it says: "cannot convert from 'System.Drawing.Bitmap' to 'byte[]'" for image and "cannot convert from 'string' to 'byte[]'" for text file. Help! UPDATE: Solved below. Add the files you want to your solution and then set their Build Action property to Embedded Resource . This will embed the file

Writing a Cross-Platform (32-bit and 64-bit compatible) Program for Windows (like AnyCPU in .NET)

£可爱£侵袭症+ 提交于 2019-12-01 00:31:53
问题 It's been baffling me how the "AnyCPU" feature in .NET works: It loads the executable as native 32-bit if the system is 32-bit, and as 64-bit if the system is 64-bit (which you can easily confirm with Task Manager). So obviously, this isn't impossible. The question is, how exactly did Microsoft do this? Windows originally didn't know about the .NET framework, so the Windows PE Loader can't possibly look for any extra features in PE headers for the CLR header; this feature must have been added

How to start a process in the same folder as its executable

痞子三分冷 提交于 2019-12-01 00:06:47
问题 I'm trying to start an application programatically, but it always runs it in the folder of my application... For example: If my app is located in C:\MyApp\myapp.exe and the other app is in C:\OtherApp\otherapp.exe, how can I start the other app in the folder in which it resides, rather than in the folder where my app resides? Here is how I start the other app: private void StartApp(OtherApp application) { Process process = new Process(); process.StartInfo.FileName = application.FileName;

Set an exe icon for my program

我们两清 提交于 2019-11-30 22:28:09
问题 I'm using Microsoft Visual Studio 2008 and I'm trying to set an exe icon for my program. I've searched this site and found this: How do I set the icon for my application in visual studio 2008? But I can't find this "Resource View". I've looked everywhere in MVS08 How may I access Resource View and set the main icon for my application? 回答1: Ben had a good start to the question along with the help of Tymek, but you need to go to the next step. Once you have added your icon to your resources,

How is code stored in the EXE format?

萝らか妹 提交于 2019-11-30 21:35:12
My questions are as follows: How does the Portable Executable format (on windows/unix) relate to the x86/x64 instruction set in general? Does the PE format store the exact set of opcodes supported by the processor, or is it a more generic format that the OS converts to match the CPU? How does the EXE file indicate the instruction set extensions needed (like 3DNOW! or SSE/MMX?) Are the opcodes common across all platforms like Windows, Mac and unix? Intel i386 compatible CPU chips like ones from Intel and AMD use a common instruction set. But I'm sure ARM-powered CPUs use different opcodes. Are

Creating executable for Windows using Qt on Linux

橙三吉。 提交于 2019-11-30 20:43:58
Is it possible to create an executable on Linux for both Linux and Windows using the same Qt code with Eclipse? Or is it necessary to install Qt Creator on my Linux machine? If you want to build a windows binary on linux you need to cross-compile. This means you need to have a windows cross-compiler installed plus the libraries you are linking with built with the cross compiler . For a basic Qt program this means you need at least a cross-compiled Qt. Cross-compiling has nothing to do with Eclipse or Qt Creator. I don't think both support cross compiling out of the box but I guess you could