I've got a .NET compact framework application that I'm porting from Windows CE to Windows Mobile 6.1. The application offers the ability to launch the File Explorer opened to a particular folder as a time-saver for the user when they need to interact with the file system.
The code to do this is trivial (note that profileLocation has the path to the target folder to view):
try
{
string fileExplorer = "\\windows\\fexplore.exe";
Process.Start(fileExplorer, "/root," + profileLocation);
}
catch
{
MessageBox.Show("Could not open " + profileLocation);
}
FYI, this is similar to the code found here on SO (.net cf - launch explorer programmaticly).
This works wonderfully on the Windows CE device (and a version of this code works on the full desktop version of the app too), but on the Windows Mobile version the code does nothing. It does not throw the exception (so I know the process is started at least), but neither does it seem to start the File Explorer.
My first thought was that it was started, but is just behind my application in the stack. But I have confirmed via CE Remote Spy and CE Remote Process Viewer that the process is not present at all.
Has anyone achieved this before on a Windows Mobile device?
EDIT:
Based upon the suggestion below, I have confirmed that the following code does work:
Process.Start(fileExplorer, null);
Now I just need to determine what command line options can be used to get File Explorer to launch with the desired file location selected. Anyone know what command-line options are available for FEXPLORE on WinMo?
Possibly fexplore.exe is blacklisted. Can you start fexplore manually?
Try without using a argument and just launch fexplore.exe.
Try your code with another exe.
Generally the code should work fine on windows mobile 6.1.
Related
I have this simple piece of code, adding my application to run when windows start. Works fine.
RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
rk.SetValue("my_app", Application.ExecutablePath);
Then I package it with a Windows Application Packaging Project, connect it to windows store, choose "Create App Packages.." and get the resulting .appxbundle.
Fine so far. I install it locally. (also installing the generated certificate (.cer) so I can install it at all.)
Once I start the installed app and click a button running the code above, nothing changes in the registry! It does not crash, I have a try..catch around the code. It just silently ignore it.
Running it from visual studio works fine, the registry gets updated.
Actually, all I want is the app to start when windows start, I am not particularly interested in how to achieve that, so any ideas are welcome!
Edit: I forgot to say the most important stuff: It is a Windows Desktop, Windows Forms App. It is not a UWP app, but a window inheriting an ordinary System.Windows.Forms.Form, compiled with x86.
Xavier mentions the StartupTask extension, it's a nuget package but it seems to be used when you have a UWP app.
Actually, all I want is the app to start when windows start, I am not particularly interested in how to achieve that, so any ideas are welcome!
You need to use the windows.startupTask Extension for your packaged UWP app. Please see Start an executable file when users log into Windows. With this extension, you can start your app whenever a user logs on.
Please note: The user has to start your application at least one time to register this startup task.
I have a web application that runs internally. I need to run an executable (command line application written in C#) from the browser by passing it 2 parameters.
Infrastructure:
Windows XP - 8
Internet Explorer 6+
C# (.Net 4.0)
The code the launches the executable:
var scanApp = new ActiveXObject("WScript.shell");
scanApp.run("C:\\Path\\To\\exe param1 param2", 1, true);
The above works on my local machine because I have the exe in a known location (on my desktop).
My question is, how best can I deploy this on a client machine through activex and then run the executable?
The workflow would be:
1. Go to webpage
2. Click link that attempts to launch exe
3. Activex 'installs/downloads' the exe to a known location if its not there already
4. Run the exe
TLDR
How to deploy an executable through ActiveX and then launch it whenever user clicks on a webpage button?
Is it necessary that the installation occur through ActiveX? If not and you can deploy a different way (Group Policy, ClickOnce, etc), you can register a protocol handler to accomplish your second goal (similar to how iTunes is registered as a handler for itunes:// links). Just make that part of the install script.
For more information on that topic, see here or here.
I have a WPF application developed and been testing already for a few months.
When it's installed on the client's computer the application starts and no window is visible. The task manager shows the application is running.
The application is writing all activities in few log files and it looks like it is doing something but no visible screen.
What can be a possible cause of the problem ?
Why it is invisible on that specific machine ? The machine is Windows 7 64x bit
The installed frameworks are v1.0 1.1 v2.0 v3.0 v3.5 v4.030319
The strange thing is the application was working before.
You should check Windows Event log (Type eventvwr in run dialog or go to viewer by Computer Management dialog of Windows) to get info about the problem. The reason is most likely your application has an exception before your main window is opened. So you see that process is running in task manager but windows did not show up.
The reason in event log could be anything. May be your app requires a file in a specified path but not found. I meany anything that causes an except,on could be your problem.
I am running into an issue when attempting to use MapPoint libraries within our C# .NET application from a published app on a Windows Server 2008 machine. When instantiating the MapPoint.MapClass, I get the error:
"Your registry settings for this application were not copied correctly. To correct these settings, run Setup again for this application from the location where you originally installed it."
I am able to launch MapPoint just fine by itself outside of the app, the error only comes up when running the published app. We have multiple servers that clients run the app on, and the server running Server 2003 is able to launch MapPoint just fine. In addition, XP and Win7 machines also work fine. We also have a Foxpro application that also utilizes MapPoint's API installed on the 2008 server, and it doesn't have any issues.
MapPoint is included as a COM reference in the VS project referring to "Microsoft MapPoint 13.0 Object Library (North America) 8.3".
Looking online, I found a bunch of possible solutions, but nothing worked. I have tried:
Uninstalling MapPoint 2006 entirely and manually removing all entries from the registry, then reinstalling
Doing the same as 1 but then installing the trial of MapPoint 2011, resulting in the exact same error message
Disabling UAC
Setting MapPoint.exe's compatibility mode to Server 2003 and XP
Please let me know if anyone has any other suggestions.
it does sound like something is partially installing / being blocked. Is this a user issue? Ie. Can you install for all users?
it doesn't explain the MP2006 issue, but I would avoid the trial version for API work - the trial nag screen can be a problem. Eg. If you start the app hidden, the user cannot always see the nag screen to dismiss it.
You say you are instantiating a Map class. What about the Application (or _Application) class: you must have one of these to create the Map.
I'm moving from Windows CE 6 to Windows Embedded Standard 7 for a project and am wondering how remote debugging of .Net apps works with Windows Embedded target devices. In CE with VS2008 and ActiveSync (USB), I can hit F5 and my app is automatically deployed to the target device and executed so I can step through my breakpoints just like I would if I were debugging locally.
Is there an equivalent remote debugging solution for Windows Embedded debugging? A quick glance through the Visual Studio "Remote Debugger" documentation makes the whole thing seem a lot clunkier/less integrated. Is there an easy way to debug applications on target devices running Windows Embedded like I would with CE?
Thanks,
Ben
I only have experience doing this over standard network interfaces on a Embedded Std7, but I guess the approach using an ActiveSync connection is exactly the same (as ActiveSync devices like my cellphone turn up under 'My Computer'); in short:
suppose the Embedded device is on \\Embedded
share a directory on the Embedded device, say 'temp'
start the remote debugger client on your device
point the output directory of your VS project to \\Embedded\temp
set the options for your project to remote debugging on \\Embedded
hitting F5 will build the exe, put it in \\Embedded\temp and start debugging it
Look here for the document that got me started.