Windows Mobile 6.5 Silent Uninstall - windows-mobile-6.5

I would like to silently uninstall a Program that was installed from a CAB File with wceload.
This Program also appears in Remove Programs. Is there a way to uninstall with command line?
I have found this Xml Configuration but i dont understand how to execute this commands.
Is there a Program on Windows Mobile to run this XML Files?

I do not see the uninstall wap provisiong xml you need to uninstall an application automatically on the link you provided.
You need:
<wap-provisioningdoc>
<characteristic type="UnInstall">
<characteristic type="Application 2">
<parm name="uninstall" value="1" />
</characteristic>
</characteristic>
</wap-provisioningdoc>
see http://msdn.microsoft.com/en-us/library/gg155034.aspx
to process such xml you need either a mobile management framework or use a simple app that uses DMProcessConfigXML. See http://msdn.microsoft.com/en-us/library/bb158518.aspx. That means you need to write a little app that uses this API call.
On some devices (ie by Intermec) processing of xml is supported directly. For Intermec devices you just need to copy the xml to \Smartsystems\ConfigDir on the device.
From a PC you can use RAPIconfig to process such xml on a device using ActiveSync/WMDC. See http://msdn.microsoft.com/en-us/library/bb737308.aspx.

Related

Must reboot after changing PATH

It could be that this is no strictly speaking a WIX issue, but it should be a well known problem related to setup with well established best practices. I just can't find these practices on Google. Using WiX 3.6, Windows 7, Visual Studio 2008, but the installation must support Windows from XP to newer.
I'm installing a COM object that depends on some third party DLLs. The object itself is registered okay, and all the DLLs are installed in installation folder, and setup adds this folder to system's PATH environment variable. The code looks like this:
<Component Id="RequiredLibraries" Guid="$(var.RequiredLibrariesGUID)">
<?include redist.wxi?>
<Environment Id="PATH" Name="PATH" Value="[INSTALLDIR]" Permanent="no" Part="last" Action="set" System="yes" />
</Component>
On my machine I can use the object immediately after installation, but on some machines I must reboot the computer. This reboot is a pain, and I don't know why is it necessary, nor why only on some machines. I can <ScheduleReboot After="InstallFinalize"/>, but I'm hoping for some better solution. So, feel free to answer any of these questions:
What is the best common practice for this issue? I can't pack everything to a single DLL, so I need a solution for several DLLs.
What I could I do to enable the use of the COM object (by making the change to PATH visible to the rest of the system), without resorting to reboot, or user relogin, or Explorer restart? Does Windows Installer broadcasts WM_SETTINGCHANGE message? Should I broadcast it in custom action?
How could I detect and ask the user to reboot/relogin only if it is required, and not always? (reboot is not required on some machines)
How can I schedule something less painful than reboot that works just as well?
There are two scenarios I know of:
1) Application doesn't honor WM_SETTINGCHANGE broadcasts ( typically anything hosted by service control manager )
2) A behavior in MSI when it chooses not to send the broadcast. Per WriteEnvironmentStrings Action:
(emphasis added)
Environment variables do not change for the installation in progress
when the WriteEnvironmentStrings action or RemoveEnvironmentStrings
action are run. On Windows 2000, Windows Server 2003, Windows XP, and
Windows Vista this information is stored in the registry and a
WM_SETTINGCHANGE message is sent to notify the system of the changes
when the installation completes. Another process can receive
notification of the changes by handling these messages. No message is
sent if a restart of the system is pending. A package can use the
MsiSystemRebootPending property to check whether a system restart is
pending.
I've worked around #2 by writing a .NET custom action (using Environment class) that makes a meaningless change just to get the broadcast to occur after MSI has done it's thing.

Convert AJAX web app to cross platform desktop app run from CDROM

We have a very basic web application which uses AJAX to pull data from XML files for a simple autocomplete and search script.
Our client wants to distribute this application on CDROM to their clients rather than running from the web.
Basically all we really need is a way to wrap these html, xml, js & css files into executables that will work on Windows, Mac & Linux. Basically the user should just need to run the one file to load the application into a typical desktop window.
We have investigated the following:
Titanium Desktop SDK - we received errors when packaging to linux & mac distributables. Also, the Windows distribution requires an install process which we want to avoid. The user should just be able to run the file directly from the CD without needing to install anything on their Desktop.
Zinc 4.0 - using the HTML wrapper resulted in an executable similar to what we need - but only for Windows. Also, the rendering engine used seems to lack support for transparencies which interferes with our design.
Stunnix Advanced Web Server - We really want something that doesn't require installations, or the startup of a bunch of extra services.
Mirabyte DiscStarter - Only supports windows and like Zinc, seems to use an old IE rendering engine without support for transparencies.
What we really need to know is there anything that can simply "wrap" a basic AJAX app to enable it to be run cross-platform on desktops without internet access?
If you include just the HTML file, when someone clicks on it, that local copy will open instantly in their browser.
If you needed to, you could open a separate window using JavaScript which contains that HTML page, that way it has it's own window.
You can create a desktop application built with HTML/CSS/Javascript using either of the following two frameworks
TideSDK
AppJS

VB6 app: rich textbox control

I have taken responsibility of a VB6 app.
I installed the VB6 IDE on one of my older machines. When I compile the app and copy the .exe to client machines, the Rich Textbox control breaks the app and causes a run-time error.
How important is it what machine you compile an app on? Is it possible that the app is expecting a control with a different ID and therefore there is a run-time error?
You need to deploy the Rich Textbox control richtx32.ocx to the client machines. These tables show it is not part of Windows, you need to deploy it yourself.
You might want to create an install for your program.
You could look into using a manifest so that you can just copy your program and its dependencies (like richtx32.ocx).
You could just manually copy the OCX file and use regsvr32 to register the OCX. This will quickly become unmanageable if you have more dependencies or many machines to deploy onto.

Create Windows service from executable

Is there any quick way to, given an executable file, create a Windows service that, when started, launches it?
To create a Windows Service from an executable, you can use sc.exe:
sc.exe create <new_service_name> binPath= "<path_to_the_service_executable>"
You must have quotation marks around the actual exe path, and a space after the binPath=.
More information on the sc command can be found in Microsoft KB251192.
Note that it will not work for just any executable: the executable must be a Windows Service (i.e. implement ServiceMain). When registering a non-service executable as a service, you'll get the following error upon trying to start the service:
Error 1053: The service did not respond to the start or control request in a timely fashion.
There are tools that can create a Windows Service from arbitrary, non-service executables, see the other answers for examples of such tools.
Use NSSM( the non-Sucking Service Manager ) to run a .BAT or any .EXE file as a service.
http://nssm.cc/
Step 1: Download NSSM
Step 2: Install your sevice with nssm.exe install [serviceName]
Step 3: This will open a GUI which you will use to locate your executable
Extending (Kevin Tong) answer.
Step 1: Download & Unzip nssm-2.24.zip
Step 2: From command line type:
C:\> nssm.exe install [servicename]
it will open GUI as below (the example is UT2003 server), then simply browse it to: yourapplication.exe
More information on: https://nssm.cc/usage
these extras proved useful.. need to be executed as an Administrator
sc create <service_name> binpath= "<binary_path>"
sc stop <service_name>
sc queryex <service_name>
sc delete <service_name>
If your service name has any spaces, enclose in "quotes".
Many existing answers include human intervention at install time. This can be an error-prone process. If you have many executables wanted to be installed as services, the last thing you want to do is to do them manually at install time.
Towards the above described scenario, I created serman, a command line tool to install an executable as a service. All you need to write (and only write once) is a simple service configuration file along with your executable. Run
serman install <path_to_config_file>
will install the service. stdout and stderr are all logged. For more info, take a look at the project website.
A working configuration file is very simple, as demonstrated below. But it also has many useful features such as <env> and <persistent_env> below.
<service>
<id>hello</id>
<name>hello</name>
<description>This service runs the hello application</description>
<executable>node.exe</executable>
<!--
{{dir}} will be expanded to the containing directory of your
config file, which is normally where your executable locates
-->
<arguments>"{{dir}}\hello.js"</arguments>
<logmode>rotate</logmode>
<!-- OPTIONAL FEATURE:
NODE_ENV=production will be an environment variable
available to your application, but not visible outside
of your application
-->
<env name="NODE_ENV" value="production"/>
<!-- OPTIONAL FEATURE:
FOO_SERVICE_PORT=8989 will be persisted as an environment
variable to the system.
-->
<persistent_env name="FOO_SERVICE_PORT" value="8989" />
</service>
Same as Sergii Pozharov's answer, but with a PowerShell cmdlet:
New-Service -Name "MyService" -BinaryPathName "C:\Path\to\myservice.exe"
See New-Service for more customization.
This will only work for executables that already implement the Windows Services API.
I've tested a good product for that: AlwaysUp. Not free but they have a 30 days trial period so you can give it a try...
I created the cross-platform Service Manager software a few years back so that I could start PHP and other scripting languages as system services on Windows, Mac, and Linux OSes:
https://github.com/cubiclesoft/service-manager
Service Manager is a set of precompiled binaries that install and manage a system service on the target OS using nearly identical command-line options (source code also available). Each platform does have subtle differences but the core features are mostly normalized.
If the child process dies, Service Manager automatically restarts it.
Processes that are started with Service Manager should periodically watch for two notification files to handle restart and reload requests but they don't necessarily have to do that. Service Manager will force restart the child process if it doesn't respond in a timely fashion to controlled restart/reload requests.
You can check out my small free utility for service create\edit\delete operations. Here is create example:
Go to Service -> Modify -> Create
Executable file (google drive): [Download]
Source code: [Download]
Blog post: [BlogLink]
Service editor class: WinServiceUtils.cs
Probably all your answers are better, but - just to be complete on the choice of options - I wanted to remind about old, similar method used for years:
SrvAny (installed by InstSrv)
as described here:
https://learn.microsoft.com/en-us/troubleshoot/windows-client/deployment/create-user-defined-service
I have another method, using the open-source library called Topshelf.
I used it in a c# project, but maybe its available in different programming languages.
Here's a video that explains how to use it a little.
https://www.youtube.com/watch?v=y64L-3HKuP0
The crux of this issue for a lot of people is that you can't install any old .exe as a service unless you use the old method that Tomeg used. I couldn't find the windows nt toolkit that's needed to get that to work.
I was stuck in a corner and this was my way out.

Install CAB file from FireFox or command line

I have a CAB file that contains a few DLLs, and an OCX ActiveX control, an OSD describing the contents, and an INF for installing the DLLs and ActiveX control. These are coming from a 3rd party, so I can't control anything except how they are distributed to the client.
They are being used within a Java applet, and they work cross browser, but only IE seems to support actually installing the CAB file.
The installation is being done via:
<OBJECT classid="clsid:actual-class-id-here" NAME="name"
width="0" height="0" codebase="xxxx.cab#Version=w,x,y,z">
<param name="useslibrary" value="xxxx">
<param name="useslibrarycodebase" value="xxxx.cab">
<param name="useslibraryversion" value="w,x,y,z">
</OBJECT>
So, I need a way to install this CAB file that will work cross browser. Since the above will only work via IE, I need an alternative, or I need a way to install it from the command line, which would be a reasonable workaround (I could then set up an installer to take care of it). This needs to work on XP through Vista.
Any help would greatly be appreciated!
EDIT: Installing from command line would be much preferred, as then I could do a solution that isn't specific to IE, FireFox, or any other browser.
Ok, so I finally tracked down a website that gave something useful:
http://www.msfn.org/board/install-inf-file-c-t104891.html
And the resulting command I will likely use:
rundll32.exe advpack.dll,LaunchINFSectionEx .\xxxx.inf,,C:\path\to\xxxx.cab,4
Which I think will do exactly what I want. Now I just need to create a simple installer, and it should all tie together nicely!

Resources