Windows Mobile fails to uninstall - c++

Testing my app on some WM Std 6.1 I found out that it fails to uninstall. I receive this error:
“[app] was not completely removed. Do you want to remove it from the list of installed programs?"
Checking my setup.dll I can tell that Uninstall_Init and Uninstall_Exit are being called each time but all the files stays (they are not locked, I’ve checked) and its entry doesn’t disappear from the list of installed apps (whether I choose it to stay or not).

There are really only three possible reasons for this:
Uninstall_Init doesn't return continue.
Uninstall_Exit doesn't return continue.
The installer engine failed.
If you have verified that 1 & 2 then ok then 3 is going to be tough to figure out.
Some problems that I have encounted:
Check the DLL dependencies of your setup DLL and try to remove as many as possible. I've found that dependencies to MSXML can cause problems.
Remove any registry setup in your INF file, move it into your setup dll. I've found this to cause the uninstall to fail randomly on random devices because of this.
What I needed up doing for existing customers is write a uninstall application to remove our application manually if the uninstall worked. If you do need to write a manual unistall you need to do the following:
* Remove all your registry keys
* Remove all your files
* Remove registry key HKLM\Security\AppInstall{app name}
* In WM6.1 you need to remove a database record from the EDB database "SwMgmtMetadataStore" where the SWT_INSTALL_NAME_TAG property equals your {app name}.

Another thing worth investigating is the install log created by the cab install/uninstall process.
You can find this within the \Application Data\Volatile\ directory (usually called setup.log).
Copying this file to your desktop PC and opening it in notepad may provide more clues (such as files in use during uninstall) as to why the uninstall did not succeed.

I had several CAB files that worked perfectly on WM 6.0, but stopped working in WM 6.1.
Turns out it was because either the AppName or the Manufacturer had spaces in. Removing the spaces fixed the CAB files and they now successfully uninstall in WM 6.1!!

Related

iOS build on PC paired to Mac - app.dSYM.zip fails, 'Show IPA File on Build Server' missing, errSecInternalComponent, 'IPA is not a valid zipfile'

I have a Xamarin iOS application in VisualStudio 2019 on a Windows 10 PC. I build it on the PC, and when possible then right click the project and choose Show IPA File on Build Server, then on my Mac I upload the file to the app store using Transporter. I am encountering these issues:
Whenever I build, the build says it failed with message "There was an error unzipping the file bin\Ad-Hoc\MyApp.app.dSYM.zip: Could not find a part of the path 'C:\MyDirectory\MyApp.iOS\bin\Ad-Hoc\MyAppiOS.app.dSYM'." This has not historically caused any issues - we have still been able to upload the IPA to the app store and deploy our app - but I include it in case it's relevant to the other issues.
Sometimes, my build fails saying it "has been disconnected while waiting a post repsonse to topic xvs/Build/.../execute-task/MyApp.iOS/...Codesign" or "Unable to connect to Mac Server with Address='192.111.111.111' and User='My Username'. The build can't continue without a connection". I'm assuming a wifi issue must cause this, though the machines are all right next to one another and next to my router so seems odd. Occasionally when I try to pair to the Mac, I also get the message "Error, Couldn't connect to com. Please try again. An attempt was made to access a socket in a way forbidden by its access permissions." In any case, makes me wonder if there's any way for me to 1) hardwire the Mac to the PC or 2) build directly on the Mac instead of through VS on the PC, even though I write the code on the PC?
During the build, I periodically get an error "/Users/myUser/Library/Caches/Xamarin/mtbs/builds/MyApp.iOS//bin/Ad-Hoc/MyAppiOS.app: errSecInternalComponent MyApp.iOS C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets 2003". If I lock all keychains on the Mac this goes away on the next build, but then it reappears a few builds later.
Once the build finishes with just the .dSym.zip error, most of the time, the "Show IPA File on Build Server" option still does NOT show up (not greyed out - it is not present in the menu at all) when I right click the iOS project. To get around this, I have been copying the file over to the Mac via S3. I'm wondering why the option doesn't show up, and if there's a way to just find the built file on the Mac rather than copying it over from Windows?
I then use Transporter on the Mac to upload the IPA file to the Apple Store. It always is able to read the version information and says the file is Delivered. However, often I then get an email from Apple saying the build failed because "ITMS-90688: This IPA is invalid - While unzipping the IPA we received the error message [ End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of MyAppiOS.ipa or MyAppiOS.ipa.zip, and cannot find MyAppiOS.ipa.ZIP, period. ] Verify that the IPA can be unzipped before reattempting your upload.".
In response to that error, I've tried to unzip the IPA file and I find that on the PC it is always unzippable if I change the extension to .zip, and on my Mac, I can always unzip it to see the Payload directory, and the MyAppiOS item inside it can never be opened - I get a popup "You can't open the application 'MyAppiOS' because it is not supported on this type of Mac." - in any case, the files Apple likes and the ones it doesn't look the same to me when I try unzipping.
My only ideas are to try to figure out how to open and build the app on my Mac, to call my router company, and to keep trying and trying, over and over again, until finally one of the builds works... which sometimes literally takes hours.
Many thanks for any help you are able to offer!

Launch a program at login without permissions (fedora 20)

I'm currently developing an application with QT 4.8 with a "Launch on login" option. My main problem currently is that I can't seem to find a proper way to make the program launch itself after login on Linux (Fedora 20 in my case).
My program should be able to run in the background without stopping fedora to launch.
I would also like to avoid having to ask for any sort of admin privilege since my application doesn't require any (except maybe for this option).
Finally found out about "home/.config/autostart/.desktop".
I'll have to create autostart if it's not created but from there I can chose to make or delete the file depending on what my user decided to do.
The .desktop file have to follow a particular syntax (which is not a problem for me)
[Desktop Entry]
Type=Application
Exec=</path/to/binary or command to execute>
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=<Name_to_be_displayed>
Comment=<optional comment>
In my case, I can just remove the "comment" line since just the name of the application should be enough for the user to recognize it.
You can Either keep your executable in side /etc/rc.d/rs or inside /etc/init.d folder, so that it can automatically start once device is up.
Hope this Helps.
Each user has a .bashrc file located in their home directory, you could append a command to run your application to the end of that.
That will run when only that user logs in (I think either with graphical or terminal session)
To run for all users, look at creating a systemd service if you dare, or append a line to the end of /etc/rc.local. You'll need to be root for that though.
EDIT: Don't forget to put an ampersand at the end of the command to run in background.

Virtualbox “Callee RC: REGDB_E_CLASSNOTREG” (0x80040154)?

I was getting the Virtualbox problem
Callee RC: REGDB_E_CLASSNOTREG” (0x80040154)
all of a sudden. Problem started on VirtualBox 4.3 (I think). I upgraded to version 5 hoping to fix it but had no luck at that point.
My solution:
Check your directory C:\Users\yourname\.VirtualBox\ (yourname is in fact your username.)
On my PC there was a VirtualBox.xml with size of 0 Kb.
Also there was a VirtualBox.xml-prev with a size of 3 Kb.
Dates where somewhere around the time the problem started...
Renaming the VirtualBox.xml-prev one to the VirtualBox.xml SOLVED my issue.
For those without an xml file, here is my xml file, hopefully it helps .....
<?xml version="1.0"?>
<!-- ** DO NOT EDIT THIS FILE. ** If you make changes to this file while any VirtualBox related application ** is running, your changes will be overwritten later, without taking effect. ** Use VBoxManage or the VirtualBox Manager GUI to make changes. -->
-<VirtualBox version="1.12-windows" xmlns="http://www.innotek.de/VirtualBox-settings">
-<Global>
-<ExtraData>
<ExtraDataItem value="general,system,previewClosed,display,storage,audio,network,usb,sharedFolders,description" name="GUI/DetailsPageBoxes"/>
<ExtraDataItem value="m=59397901-1440-48ea-8781-6f86d06c7fbb" name="GUI/GroupDefinitions/"/>
<ExtraDataItem value="m=Sharepoint" name="GUI/LastItemSelected"/>
<ExtraDataItem value="415,153,770,550,max" name="GUI/LastWindowPosition"/>
<ExtraDataItem value="D:/virtualbox" name="GUI/RecentFolderHD"/>
<ExtraDataItem value="D:\virtualbox\Sharepoint.vdi;" name="GUI/RecentListHD"/>
<ExtraDataItem value="334,1261" name="GUI/SplitterSizes"/>
<ExtraDataItem value=",confirmGoingScale,remindAboutAutoCapture,remindAboutMouseIntegration,showRuntimeError.warning.HostAudioNotResponding,confirmInputCapture,warnAboutInaccessibleMedia" name="GUI/SuppressMessages"/>
<ExtraDataItem value="53" name="GUI/UpdateCheckCount"/>
<ExtraDataItem value="1 d, 2015-08-19, stable, 5.0.0" name="GUI/UpdateDate"/>
</ExtraData>
-<MachineRegistry>
<MachineEntry src="D:/virtualbox/Sharepoint/Sharepoint.vbox" uuid="{59397901-1440-48ea-8781-6f86d06c7fbb}"/>
</MachineRegistry>
-<MediaRegistry>
<HardDisks/>
<DVDImages/>
<FloppyImages/>
</MediaRegistry>
-<NetserviceRegistry>
-<DHCPServers>
<DHCPServer enabled="1" upperIP="192.168.56.254" lowerIP="192.168.56.101" networkMask="255.255.255.0" IPAddress="192.168.56.100" networkName="HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter"/>
</DHCPServers>
</NetserviceRegistry>
<SystemProperties exclusiveHwVirt="false" LogHistoryCount="3" webServiceAuthLibrary="VBoxAuth" VRDEAuthLibrary="VBoxAuth" defaultHardDiskFormat="VDI" defaultMachineFolder="C:\Users\yourname\VirtualBox VMs"/>
<USBDeviceFilters/>
</Global>
</VirtualBox>
I had the error...
Failed to create the VirtualBoxClient COM object.
The application will now terminate.
Callee RC: REGDB_E_CLASSNOTREG (0x80040154)
...when starting VirtualBox as normal user. Starting as administrator
worked on the other hand.
System: Windows 8, VirtualBox 5
Actually, the issue "suddenly" appeared after I played around with raw disk accesses. During these test, I re-installed VirtualBox as administrator.
What people not always know is that the registry has also an access right management, like files. Right-click on a folder to access the Autorisations window to display them.
When I re-installed as administrator, the registry keys where created with an admin level access. By this, I wasn't able anymore to start VirtualBox as non-admin.
Re-installing as normal user did not solve the problem. Probably because some admin-level keys could not be deleted.
Solution that worked for me:
Back-up .VirtualBox (optional, as all backups are :-)
Uninstall VirtualBox
Open Registry Editor regedit.exe as administrator.
Delete all remaining VirtualBox keys (especially the .NET, driver registrations, Compatibility Manager settings)
Reinstall VirtualBox using a user account.
Notes:
I did not test escalating the VirtualBox uninstaller process to administrator level with sysinternals. That might work as well.
Be careful with regedit. The GUI is quite '90s. Good to know: CTRL+F searches below the currently selected key, so be sure to go to the top when start searching.
I had one key for an USB driver that I wasn't able to delete due to access rights problems. Finally, this was not needed anyway.
Please don't forget to change access rights on VirtualBox disk files when they have been created with VirtualBox running as administrator.
Renaming the VirtualBox.xml-prev one to the VirtualBox.xml solved my issue.
After you upgrade to VirtualBox-5.0.8-103449 started getting error: Virtualbox "Callee RC: REGDB_E_CLASSNOTREG" (0x80040154)
No advice on the Internet did not help.
It helped only delete the entire contents of the folder "C:\Users\"user"\. VirtualBox" and then restart Oracle VM VirtualBox shortcut on the desktop.
Apparently when you remove the previous version of Virtualbox folder
"C:\Users\"user"\.VirtualBox" is removed.
As the contents of the folder should be removed manually after reinstalling VirtualBox, as well as in case of damage VirtualBox, for example due to lack of space on the hard disk.
Not to be confused with the folder "C:\Users\"user"\VirtualBox VMs"
This folder appears later, only after the establishment has a particular virtual machine.
sorry for machine translation.
In my case this error was caused by a zero-byte truncated VirtualBox.xml in the user's .VirtualBox folder. I found out after downgrading to 4.x and getting a more descriptive error message regarding a missing < tag.
As I already suggested on superuser, as of today (09/09/2015).
Upgrade to the new version that was released.You can find it here
There have been some changes concerning the Windows 10 Problems.
The solution is in the last paragraph.
I happened to have a different cause for the same error message under VirtualBox 5.0.20.
So I temporarily installed VirtualBox 5.1.10 which tries to analyse the situation and gives more info about probable culprit.
In my case the error message from VB 5.1.10 looked like following:
Failed to instantiate CLSID_VirtualBox w/ IVirtualBox, but CLSID_VirtualBox w/ IUnknown works.
PSDispatch looks broken by the 'xxx' ({11B6009E-3F04-4478-A807-30FBD579FC07}) program, suspecting that it features the broken oleaut32.msm module as component {997FA962-E067-11D1-9396-00A0C90F27F9}.
We suggest you try uninstall 'xxx'.
See also https://support.microsoft.com/en-us/kb/316911 .
Result Code:
E_NOINTERFACE (0x80004002)
Component:
VirtualBoxClientWrap
Interface:
IVirtualBoxClient {d2937a8e-cb8d-4382-90ba-b7da78a74573}
Where 'xxx' is here a placeholder name for a specific program name it mentions and suggests to uninstall. (The specific name in my case is not important here).
So I did uninstall the specific program the new VirtualBox version accused, and after that VB started working again. Then I reinstalled the old VB version 5.0.20 I needed to continue using and all was well.
After some researching I found this thread with the step:
find C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv\VBoxDrv.inf right click and select Install
I had this same issue, I believe something corrupted whilst shutting down without correctly closing connections and I couldn't boot VB.
Tried all of the solutions above but none of them worked.
Without Uninstalling I went to the virtual box website and grabbed the most recent version and installed over the top and VB jumped into life.
Version 6.0.14 From 6.0.10

Firebreath plugin on windows fails to load in chrome

I am busy converting by existing firebreath plugin here to use gpgme instead of making calls via the OS and the gpg binary.
I have managed to get the code to compile in windows using VS 2010 on a x32 system but after loading the plugin into chrome I can not access the npapi code at all. Even simple version calls fails.
When loading the plugin I get no visible errors but when using sawbuck log viewer for chrome I get the erorr messages below.
.\renderer\webplugin_delegate_proxy.cc 347 PluginMsg_Init returned false
..\plugins\npapi\webplugin_impl.cc 271 Couldn't initialize plug-in
I have tried to use my code with both firebreath 1.4 and 1.6 and neither versions work. After some simple debugging it seems that using any code provided by gpgme (whether its called or not) causes the plugin to break.
I came to this conclusion by doing the following.
Created a new project with firebreath (versions 1.4 and 1.6)
Add the gpgme.h headers to gmailGPGAPI.cpp and changed nothing else aside from adding the required reference paths to the project.
Build the project to create the dll (this generates the dll fine).
Replace the existing ddl in my project with the dll in step 2 and test it with the following piece of code
plugin = document.createElement('object'); plugin.id = 'plugin';
plugin.type = 'application/x-gmailtest';
document.body.appendChild(plugin);
console.log("my plugin returned: "+ plugin.valid);
console.log("my plugin returned: " + plugin.version);
This returns valid = true and the version returns what ever i set it to.
I then modified gmailGPGAPI.cpp to now return the gpg version by calling gpgme_check_version(NULL) in the version method. I used that method because its probably the simplest returning function that I could test with.
Build the plugin and copy dll to chrome extension as in step 3-4. The plugin builds fine again as expected.
Load the plugin and try to execute the code in step 4 at which point it now just returns undefined for any property or method i try to access on the plugin. No errors are printed to the console or anywhere else in chrome except for the error logged to sawbuck.
I have got no idea where to look or what to try since I cant seem to get an actionable error to work against. I have also reduced by test code to the point where its just a new project with a one line change to make it easier to find the problem.
I should note the code in the repo builds fine in linux/OSX and loads into chrome correctly so I know at some level my code does work.
Two possible paths:
You may have a DLL dependency that isn't available which keeps the plugin from loading; if you run regsvr32 on it in the state where it doesn't work on chrome, does it work?
Your plugin may be loading and then crashing. Start chrome with --plugin-startup-dialog and then when it pops up a dialog warning you that a plugin is about to be loaded attach to that process and see if the process crashes. At this point you can also set breakpoints to try to figure out how far it gets.
Double check your metadata in PluginConfig.cmake as well; sometimes unusual characters in some fields can cause issues like this.

how to replace the uninstallation part of an MSI

I've build a msi installer using a VS2010 setup project.
Now the project does not deinstall because of a "1001 Exception: Invalid format for argument machineName" (see below) inside a custom action.
I am unsucessful at uninstalling the application using the remove from the system control or msiexec /uninstall.
Is there a way to force uninstallation?
Details:
As part of a custom action I register a custom event source which my app uses for event loging into the windows log:
public override void Install(IDictionary stateSaver) {
base.Install(stateSaver);
EventLog.CreateEventSource("VeodinRecorder","Application");
}
inside of the "Uninstall" I try to remove this Eventsource with
if (!EventLog.SourceExists("VeodinRecorder"))
EventLog.Delete("VeodinRecorder"); `
The EventLog.Delete also takes machinename as second argument
So I tried to overwrite the msi used for uninstallation with msiexec /fv and changed the uninstall action:
EventLog.Delete("VeodinRecorder",".");
EventLog.Delete("VeodinRecorder","Application");
I even left the whole "uninstall action" blank.
But nothing seemed to work.
Any Hints?
The full log:
Error 1001. Error 1001. An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be fully uninstalled after the uninstall is complete. --> Invalid format for argument machineName.
MSI (s) (60!68) [22:49:00:101]:
DEBUG: Error 2769: Custom Action _3C1D0358_8969_4B01_B8FA_B6B43F4E9E4C.uninstall did not close 1 MSIHANDLEs.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2769. The arguments are: _3C1D0358_8969_4B01_B8FA_B6B43F4E9E4C.uninstall, 1,
CustomAction _3C1D0358_8969_4B01_B8FA_B6B43F4E9E4C.uninstall returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 22:49:00: InstallExecute. Return value 3.
Action ended 22:49:00: INSTALL. Return value 3.
It seems that the CustomAction.dll was not updated when I update the installation with msiexec /fv.
I now manually placed the newly build CustomAction.dll (with an empty uninstall override) into the installation folder and was able to uninstall.
Update: (Credits to #pcans) use ORCA to edit the currently installed msi and manually disable the uninstall custom action.
Just for reference I want to add that you can also patch the installed product with a minor upgrade to remove any faulty actions in the uninstall sequence before it gets called. This works because a minor upgrade is a reinstall of the same product, and not an uninstall and a reinstall of a new version (which is a major upgrade). You hence replace the uninstall sequence with a correct one before the erronous one gets run.
Creating the patch is quite complicated though, even with professional tools such as Wise or Installshield, but in certain cases this is the only fix that works to get the package properly uninstalled. A package "in the wild" in a company should be fixed this way.
Finally you can use msizap.exe from Microsoft to unregister a whole faulty package from the Windows Installer database, but this is not good since changes to the system are not rolled back at all and lots of junk is left everywhere. The tool itself also seems a bit shaky at times, sometimes creating new errors that are really difficult to fix. Preferably use it for debugging only.
One further note in this already long reply: a special case is when you run a custom action only during the uninstall sequence, and it then returns a faulty return code - sometimes even if it performed its operations ok. These actions can trigger a very annonying "uninstall only rollback situation". Effectively your uninstall is rolled back when it hits the custom action that was never run during install. This will rollback the uninstall and hence work as an installation - your product is left on the machine. Quite strange.
The bottom line: skip return codes for custom actions that are run during uninstall, use other verification mechanisms to ensure the action succeeded.