Programmatically install Apk files from C# application - c#

I need to write a program where i can select an apk files which will be installed in the connected devices(via USB) I can see many threads referring on how to install exe and msi but no useful links for installing apk from C#. Can anyone provide a clue to solve this?

With usb debugging enabled in the android device and android sdk and proper drivers on the computer you could use the adb command-line tool (sdk-path/platform-tools/adb.exe):
adb install pathToYourApk.apk
There are multiple answers regarding how to run a command-line tool with c#, for example:
How to parse command line output from c#?

Related

unable to install or run the application

System Update Required:
Cannot open database connection :
Wrong username and password :
Greetings everyone
I have the following issue with restaurant management system that is programmed in C# connected with Microsoft Access database (2019), the program is work correctly in main developer laptop while we transfer the files to target or other PC or Laptop the program show the above images as windows messages error hopefully anyone have solved the issue before or have suggestion to solve it. let know about it with appreciation and advanced in thanks.
note* even I look for the problem I try to install new framework or Microsoft Access Database Engine 2016 it doesn't work.
Download the required version of log4net dll to the system. And then open Visual studio command prompt. Then run the below command in it.
gacutil -i log4net.dll
You need to install the dll in the GAC.
If by any change there is no gacutil or Visual Studio installed then you can use powershell to install the dll into GAC. You can refer this link for that https://weblogs.asp.net/adweigert/powershell-install-gac-gacutil-for-powershell

One click install mongodb with WPF Project

I am trying to deploy a WPF Project that uses MongoDB. I want to create a One-Click installation system for the client who does not have any idea about computers. I tried creating a batch file but the best it does is, it starts the MongoDB setup file. Is there any possible way, I can install MongoDB without using their installer and bundle it with my deployed project?
You can install mongoDB unattended on Windows.
Just use the msi installer like this
msiexec.exe /l*v mdbinstall.log /qb /i mongodb-win32-x86_64-2008plus-ssl-4.0.9-signed.msi
For more details check out their official documentation on this regard here

How to include .cat and .inf file in Visual studio 2012 application

I am developing a hmi for a usb device in visual studio 2012 and I want to include usb device drivers in my program installation. I do have .cat and .inf file of the usb device but how should I include them in my hmi installation so that user doesn't have to prompt windows to search for the folders.
thanks in advance for helping me out,
Veeru
I don't know what kind of installation technology you are using; Visual Studio provides both "ClickOnce" and "Setup Projects".
With ClickOnce, I don't think it is possible to install drivers.
With a Setup Project, you will have to make a custom action that calls SetupOEMCopyInf. To make that custom action, you have to compile a Win32 DLL using C or C++.

What is the best best way to download and install msi\exe

I need to install drivers to my clients silently.
Now, I have some issues:
I don't want to install them directly from the internet using Process.Start("www.......msi") beacuse it goes really slow. I want first to download them to the computer and then run a winform application to let the client choose which driver to install.
I tried the VS Installation but I couldn't figure out how to download all the "c:\Program Files" and NOT to the "Program files (x86)" in case of a windows with 64 bits.
And I couldn't figure how to launch the winform app after the download complete, using the "custum action" didn't work.
I have different drivers for x86 and for x64, and I need to download to client's computer the drivers that he needs, how can I do that?
I have both msi and exe drivers, how can I install the exe driver silently?
If you know some third-party application I would be greatfull, this could be the best option for me!
Found the answer in Visual Studio 2012 with the InstallShield and some programming work in my code.
Thank you all :)

How to rebuild .net CF application and deploy in windows mobile emulator using command-line

Is there a ways to rebuild a c# .net CF application and deploy it in windows mobile emulator from the command-line?
This is required to create a bat file for automation.
I have taken a look at http://msdn.microsoft.com/en-us/library/aa188169(VS.90).aspx which mentions how to use the emulator from command line, but doesn't mention how to deploy an application in it.
Thanks,
Vicky
I just tried calling devenv with the /deploy switch to tell it to deploy to the target and it worked just fine:
devenv /deploy Release "MySolutionName.sln"
There are two steps involved:
Start the emulator using the Device Emulator Manager (DEM) API
Execute the target app remotely using RAPI or RAPI2
1. Start the emulator using the Device Emulator Manager API
To programmatically start your emulator you'll need to utilize the Device Emulator Manager (DEM) COM API. To do so from .NET, you'll want to use the Microsoft.DeviceEmulatorManager.Interop.9.0.dll Primary Interop Assembly, which should be found here (assuming your OS is 64 bit): C:\Program Files (x86)\Microsoft Device Emulator\1.0
While you can use the provided PIA directly, it's much easier to access the DEM API from a custom façade; fortunately, a nice wrapper has already been written and is available from MSDN, along with some great info regarding the API:
How To: Programmatically Control the Windows Mobile Device Emulators from .NET - MSDN
Note: You must "dock" the emulated device before you can use the Remote API - don't forget this step!
DEM documentation:
Device Emulator Configuration Files - MSDN
Device Emulator Manager - MSDN
2. Execute the target app remotely using RAPI or RAPI2
Once you've guaranteed that your emulator is both running and "docked", you can proceed to interact with it via the Remote API (RAPI), allowing you to upload your compiled executable to the device and execute it remotely. Here are a few examples of RAPI use:
Communicating with a Device from the Desktop (C#)
The RAPI Demo Example (C++)
Simple CE synchronisation utility with Python features (IronPython).
A demo of the Windows CE Remote API (IronPython)
RAPI Documentation:
Remote API (RAPI) - MSDN
Remote API 2 (RAPI2) - MSDN
Conclusion
This should give you everything you need to piece together a simple CLI app to programmatically launch a given app on a given emulator. Please leave a comment if you have any questions.
For deployment to the emulator from the command line, see http://sevaa.home.sprynet.com/cedeploy/

Categories

Resources