"open in IE 1.4" addon stopped working - firefox

Whenever I press on the open in IE icon, I get an error in the console:
Error: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIProcess.init]
Source File: chrome://openinie/content/openinie.js
Line: 126 (This happened ever since upgrade to 16.0 and I assume it's probably security related)
I found that js file to be inside some "openinie#wittersworld.com.xpi" file (which I cleverly renamed to zip), and saw the offending line:
var iePath = openinie.getIEPath();
// create an nsILocalFile for the executable
var file = Components.classes["#mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(iePath);
// create an nsIProcess
var process = Components.classes["#mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
process.init(file); // <-line 126
is it possible to fix it and "re-compile" it zipping and renaming?
(I assume it's something with security maybe).
can I debug this using for example an alert box to display values of variables?

is it possible to fix it and "re-compile" it zipping and renaming
Yes, you can simply replace a file in the ZIP archive, most extensions aren't signed (you can remove the META-INF directory from the XPI file if this one is). In fact, for your debugging it is better to unpack openinie#wittersworld.com.xpi into a directory named openinie#wittersworld.com in the same folder and remove the original file - this way you won't need to pack/unpack on each change. You should also start Firefox with the -purgecaches command line parameter, otherwise the file you are changing might get cached.
can I debug this using for example an alert box to display values of variables?
Yes. However, I would rather recommend Components.utils.reportError() method that will log to the Error Console (press Ctrl-Shift-J to open it) without opening modal dialogs. In this particular case I would write:
Components.utils.reportError(iePath);
This seems to point to a non-existent file meaning that the getIEPath() function is faulty.
Good luck!

Related

settingcontent-ms file tag meaning

Windows 8 has a feature: it can launch an application from the search panel (on the right side of the screen). It works like following:
Developer registers his or her application following this instruction. It is a bit legacy instruction, but the project I participate in uses this way to register its settings.
At user logon Windows creates (if none exists) a special .xml file in C:\User\<UserName>\AppData\Packages\windows.immersivecontrolpanel_cw5n1h2txyewy\LocalState\Indexed\Settings\en-US with content shown below. This file has extension settingscontent-ms
As soon as user clicked on this file, the system launches the specified application (actually explorer calls for it, as I discovered by ProcMon).
Xml file content:
<?xml version="1.0" encoding="UTF-8"?>
<PCSettings>
<SearchableContent xmlns="http://schemas.microsoft.com/Search/2013/SettingContent">
<ApplicationInformation>
<AppID>windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel</AppID>
<DeepLink>%Canonical name or application path%</DeepLink>
<Icon>%App path%,-%Resource number%</Icon>
</ApplicationInformation>
<SettingIdentity>
<PageID>%GUID as in instruction above%</PageID>
<HostID>{7E0522FC-1AC4-41CA-AFD0-3610417A9C41}</HostID>
<Condition>shcond://v1#RegkeyExists;0;Regkey;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%GUID as in instruction above%</Condition>
</SettingIdentity>
<SettingInformation>
<Name>#%App path%,-%Resource number%</Name>
<Description>#%App path%,-%Resource number%</Description>
<HighKeywords>%App decription%</HighKeywords>
</SettingInformation>
</SearchableContent>
</PCSettings>
We can see node with the name HostID. Windows writes specified in code GUID to this node, but it breaks the ability of my application to work. If I try to execute my app through this "shortcut" by clicking on xml file or chosing my app in search panel, the system shows me a message: "Unspecified error".
When I manually change the HostID value to {12B1697E-D3A0-4DBC-B568-CCF64A3F934D}, it starts to wrk fine.
I looked through registry in order to find something about these two GUIDs, but I didn't find anything. Also I looked for the difference between registry values corresponding to my app and to another, but working, app and didn't find any significand differences too.
Also I tried to delete this file and login into the system under ProcMon, I caught some moments: explorer tries to open the file and fails with ERROR_FILE_NOT_FOUND, explorer creates missing file, reads registry and writes something to created file, then it closes the file. But I didn't find anything interesting in between of these messages, that can help me to solve my problem.
I found out that registry key HKEY_CLASSES_ROOT\CLSID\%App GUID%\System.ApplicationName contains exactly the same with DeepLink tag (it was the first error in my app - specified key was empty), but the proble with "wrong" HostID remains.
Does anyone know, what it is and how to make Windows to write the rigth GUID to this tag, or at least some useful info about this tag? I just can't imagine anything else to change, but I think, that I need to change something in corresponding to my app registry keys.
I found the solution: just put app's GUID (the same as in PageID) into DeepLink.
To do this, you need to write this GUID as string value to HKEY_CLASSES_ROOT\CLSID\%App GUID%\System.ApplicationName.
That's the solution. However, I haven't found the meaning of HostID tag :(

macOS: Breakpoint when file is deleted

In my old macOS app, written in Objective-C, I am debugging a reproducible problem in which a file package is removed too early during a system frameworks call. To get a clue, I would like to have the debugger break whenever a file is deleted. To that end, I have set symbolic breakpoints in Xcode at these symbols:
unlink
unlinkat
-[NSFileManager removeItemAtPath:error:]
-[NSFileManager removeItemAtURL:error:]
All of these breakpoints resolve as expected to actual breakpoints, and they break as expected when files are deleted as expected. But during the troublesome too-early file deletion, no break occurs.
Are there any other functions in macOS which can delete files, for which I should add breakpoints?
BACKGROUND INFORMATION:
The problem occurs in my custom NSDocument subclass, when calling [super saveDocument] on a newly-duplicated (as in File > Duplicate) but never-before saved document package. Such document packages reside in ~/Library/Autosave Information/, and when things work properly, remain there until the Save panel appears, and is subsesquently dismissed. However, in the bug case, the package disappears immediately when the user clicks File > Save (or an Auto Save occurs), apparently causing a later error indicating that the deleted package could not be moved to the path returned by the Save Panel.
I also tried changing the POSIX permissions of that package after it appears, and before clicking File > Save, to octal 500. The idea is that it could not be deleted, and I also turned on all of my exception and error breakpoints, hoping the mystery deleter would squawk to the debugger console. Result: The package was not deleted, and, as I had hypothesized, the Save operation succeeded. But nothing squawked. So this mystery deleter is indeed the problem, but is apparently both stealthy and forgiving :(
UPDATE 2019-JUL-19:
After 5 days of finding other things to do, I decided to bite the bullet and use DTrace as suggested Ken Thomases. It worked, showing me that all files in the subject file package were deleted by a call to libsystem_kernel.dylib__unlink, which was in turn called by -[NSFileManager removeItemAtPath:error:].
I do not know why my breakpoints on these functions did not break for these calls, except maybe there is a clue at the bottom of the stack trace, mentioning "xpc". Is it possible that this file deletion is done by an XPC helper process? Does DTrace also probe helper processes of the process being probed? That would be pretty amazing.
Here is an abridged DTrace session transcript:
Air2 jk$ sudo dtrace -n 'syscall::unlink*:entry,syscall::rmdir:entry,syscall::rename:entry { printf("time=%d arg=%s\n", timestamp/1000000000, copyinstr(arg0)); ustack(100); }' -p `pgrep MyApp`
Password:
dtrace: description 'syscall::unlink*:entry,syscall::rmdir:entry,syscall::rename:entry ' matched 4 probes
CPU ID FUNCTION:NAME
1 178 unlink:entry time=6562 arg=/Users/jk/Library/Autosave Information/Unsaved MyApp Document.bmco
libsystem_kernel.dylib`__unlink+0xa
libremovefile.dylib`__removefile_tree_walker+0x147
libremovefile.dylib`removefile+0x99
Foundation`-[NSFilesystemItemRemoveOperation main]+0xba
Foundation`__NSOPERATION_IS_INVOKING_MAIN__+0x11
Foundation`-[NSOperation start]+0x2db
Foundation`-[NSFileManager removeItemAtPath:error:]+0x54
AppKit`__90-[NSDocumentController(NSInternal) _autoreopenDocumentsFromRecords:withCompletionHandler:]_block_invoke_2+0x90
AppKit`__89-[NSDocumentController reopenDocumentForURL:withContentsOfURL:display:completionHandler:]_block_invoke_2+0xa6
AppKit`___NSMainRunLoopPerformBlockInModes_block_invoke+0x19
CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__+0xc
CoreFoundation`__CFRunLoopDoBlocks+0x17b
CoreFoundation`__CFRunLoopRun+0xae8
CoreFoundation`CFRunLoopRunSpecific+0x1f3
HIToolbox`RunCurrentEventLoopInMode+0x124
HIToolbox`ReceiveNextEventCommon+0x164
HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter+0x40
AppKit`_DPSNextEvent+0x3de
AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]+0x548
ViewBridge`-[NSViewServiceApplication nextEventMatchingMask:untilDate:inMode:dequeue:]+0x5f
AppKit`-[NSApplication run]+0x292
AppKit`NSApplicationMain+0x309
libxpc.dylib`_xpc_objc_main.cold.3+0x38
libxpc.dylib`_xpc_objc_main+0x203
libxpc.dylib`_xpc_copy_xpcservice_dictionary
ViewBridge`xpc_connection_handler
ViewBridge`NSViewServiceApplicationMain+0xbff
com.apple.appkit.xpc.openAndSavePanelService`main+0xc0
libdyld.dylib`start+0x1
com.apple.appkit.xpc.openAndSavePanelService`0x1
(The call in that transcript apparently tried to unlink the file package, which I think would have failed since the package was not empty. It is followed by several similar calls which walk the package tree, deleting each node, and finally a repeat of that call to delete the package, apparently with success.)
UPDATE 2019-AUG-06
Although we now know the low-level cause of the problem, we still don't know the high-level cause. I have since discovered that the problem (premature deletion of the temporary document file in ~/Library/Autosave Information) only occurs in macOS 10.15 Beta 4-5 (the current version) and only when the app is built with App Sandbox OFF. When App Sandbox is on, the relevant Autosave Information is in a different location, in the app's container, so this should be a good clue! The problem is easily reproducible with a small demo app, Core Data, document-based, which I have submitted to Apple along with a short video. If anyone has a line to Apple, please direct their attention to FB6937676 !
A rename operation will make the source path no longer refer to a file (looks like the file at the source path was deleted). It can also unlink/delete a file at the destination path, although it will be replaced with the file at the source path. So, that would be rename(), renameat(), renamex_np(), and renameatx_np().
Of course, rmdir() can remove a directory, but only if it's empty.
Apparently, there's a hidden delete() system call. It's described as "delet[ing] a name from the filesystem using Carbon semantics". It's possible the frameworks are using that.

Method or data member not found compile issue

I have a VB6 project that I didn't create but I have to update, when I go to make the exe I get a compile error: Method or data member not found, and it points too "SCom1.FileReceive" in the code below. When I look at the Main form, the SCom1 control is a PictureBox.
This code has been working for the last 5 years but I don't know why SCom1 is a picturebox, or why I'm getting the error, is it a reference? SCom1 to me looks like a MSComm function? Let me know if anyone has any ideas, I just don't know VB enough to know how to troubleshoot this. Thanks
If SCom1.FileReceive = True Then
WriteToLog (Now() & " FileReceive was true, now false")
SCom1.FileReceive = False
End If
The machine which you have opened the code doesn't have the mscomm32.ocx file or the ocx file not registered properly.
When vb cannot reference an ocx, it'll convert the relevant control to a picture box control.
What you have to do is, close the project without saving. Then open system32 folder and check for mscomm32.ocx file. If the file is not there then you have to download that from the intenet. The register the file using regsvr32 command in command prompt.
After this you can open the vb6 project and start working.
=========================================================
EDIT : Included the update in the comments to the answer, this will help other users in the future... :-)
if the method name doesn't look familiar to a known ocx file (in this case the SCom1.FileReceive), the missing component can be a custom ocx file.
So check on the working machine or in project folder whether there are any ocx file exists in the relevant name (in this case SCom.ocx).
if there is a file exists in such name, register that file using regsvr32 (if not registered), then add that to toolbox, then replace the picture box control with the relevant control (make sure the name tally).

Adding LESS Extension to Dreamweaver CS5.5

Work gave me a new Macbook Pro yesterday and I'm having a hard time getting Dreamweaver CS5.5 to work with my LESS files. At first, I was getting an error saying that it couldn't open the filetype, so I hit the Adobe help areas and user forums and found the solution about editing Extensions.txt and MMDocumentTypes.xml. So now I can open the files from my local files side panel, but not from File -> Open. And despite having it listed as a Style Sheet extension, code hinting and coloring isn't working. A bizarre twist is that now if I take out my edits to those files, DW still opens the LESS files without an error. Anyone have any ideas how I can get this fully operational?
Here are a couple of the articles I found in my research and followed as best I could:
http://help.adobe.com/en_US/dreamweaver/cs/extend/WS5b3ccc516d4fbf351e63e3d117f53d6108-7fda.html
http://helpx.adobe.com/dreamweaver/kb/change-add-recognized-file-extensions.html
From what I tried today, it kind of makes sense to me now. I have it working on CS5. To get started, you should show all files on your computer. Spotlight (OS X) makes things super easy to find all instances of those files. Once you find it, CMD + R will reveal the parent folder where the file resides.
The "Extensions.txt" handles whether or not DW can open the file from the modal window/program menu. This file is located in 2 places and you should edit using "text edit" or another baside editing program:
USERS/library/Application Support/Adobe/Deamweaver
CS5/en_US/Configuration/Extensions.txt
Applications/Dreamweaver/Configuration/Extensions.txt
To do that you just need to declare a new type:
As part of the "all documents" list you need to add your SCSS,LESS
extensions
As part of the "stylesheets" list you need to add your SCSS,LESS extensions
CSS,SCSS,LESS:Style Sheets
The second file you need to EDIT, is under the folder "DocumentTypes" in CS6 I believe that folder has moved to:
USERS/library/Application Support/Adobe/Deamweaver CS5/en_US/Configuration/
However, in CS5, I found this folder in Applications/Dreamweaver/Configuration/
From here if you edit "MMDocumentTypes.xml" this file it should explain how those extensions you previously defined in "Extensions.txt" should behave. (Again, use a basic text editor).
I think somewhere on line 140 or so, you'll see the following:
<documenttype id="CSS" internaltype="Text" winfileextension="css" macfileextension="css" file="Default.css" writebyteordermark="false" mimetype="text/css" >
From here add "scss,less" to the 'winfileextension' and 'macfileextension'. Because you're on a Mac, you probably want to make sure its filled out in the 'macfileextension' attribute.
The result should look like this:
<documenttype id="CSS" internaltype="Text" winfileextension="css,scss,less" macfileextension="css,scss,less" file="Default.css" writebyteordermark="false" mimetype="text/css" >
Cheers!

Remove Error handler code from vb6 codes auto

I have used one error handler code in my all vb6 projects,
Now I have to remove that error handler code which is in all sub procedures, functions.
I have to remove it manually all the time can it be removed automatically
I approached a task similar to this one time by writing a small program that would
1) read the project's vbp file and retrieve the names of all the files in a project
and
2) would then edit each of these files and make the desired changes.

Resources