There is no disk in drive error when opening Inkscape in Windows 7

Bug #950781 reported by Jan Nonnemacher
42
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
Max Gaukler

Bug Description

I am receiving an error when opeing Inskcape 0.48.2 in Windows 7. An error window opens with Inkscape.exe - No Disk in header and message notes "There is no disk in drive. Please insert a disk in drive \device\harddisk5\DR5." Error window allows Cancel, try again and continue. When one is selected two times the error disappears. Same error then comes up when trying to open a file.

Tags: win32
Revision history for this message
su_v (suv-lp) wrote :

Try the solutions described in comment one of <https://answers.launchpad.net/inkscape/+question/129939>

tags: added: win32
Revision history for this message
su_v (suv-lp) wrote :

> When one is selected two times the error disappears. Same
> error then comes up when trying to open a file.

Had you been working with files from a removable media (opened from / saved to) last time, and this meia (e.g. USB stick) is no longer present on your system?

1) The MRU list (managed by GTK+ itself in 'recently-used.xbel' and shared with other GTK+-based applications, e.g. GIMP) is checked for the presence of related bookmarked files, and entries not found on the current system are omitted from the sub-menu in Inkscape. This check can trigger an attempt to access to a no longer present removable media.

2) Inkscape's file dialogs remember the last used locations (directories) and try to open them the next time used, and could also trigger an attempt to access a no longer present removable media.

su_v (suv-lp)
summary: - There is no disk in drive error when opeing Inskape in Windows 7
+ There is no disk in drive error when opening Inkscape in Windows 7
Revision history for this message
su_v (suv-lp) wrote :

Alternatively, if the Windows error dialog does is not triggered due to having worked with files from a removable media, it could be related to
Bug #794852 “Windows exception message if C:\ not present”
<https://bugs.launchpad.net/inkscape/+bug/794852>
(machine which has its Windows installation done to a drive letter that is not C:.)

Revision history for this message
Jan Nonnemacher (tjsnonn) wrote :

Thanks ~suv. The following suggestions worked
Try the solutions described in comment one of <https://answers.launchpad.net/inkscape/+question/129939>

Revision history for this message
Max Gaukler (mgmax) wrote :

I can confirm this bug under Windows Terminal Server 2008.
The file .recently-used.xbel contains references to no longer existing drives (unplugged USB sticks or a card reader with card removed) AFAIR it is stored in C:/Users/USERNAME/AppData/Local/Inkscape. Deleting the file causes the error to go away, but it is no permanent fix. The bug reappears from time to time and can be worked around each time by deleting the file.

Changed in inkscape:
status: New → Confirmed
Revision history for this message
Max Gaukler (mgmax) wrote :

Let's see where this could be fixed.

Inkscape uses GtkRecentManager for the recent-files menu.

inkscape-0.48.4/src/interface.cpp line 974:
    gtk_recent_chooser_set_show_not_found (GTK_RECENT_CHOOSER(recent_menu), FALSE);

(some steps inbetween, not really interesting)

gtk+-3.4.2/gtk/gtkrecentchooserutils.c line 468:
    if (!show_not_found && !gtk_recent_info_exists (info))

gtk+-3.4.2/gtk/gtkrecentmanager.c line 2044 and before:
in function gtk_recent_info_exists:
      if (g_stat (filename, &stat_buf) == 0)

glib-2.38.2/glib/gstdio.c line 496:
in function g_stat:
     retval = _wstat (wfilename, buf);

_wstat is the Win32 API Call, on which the pop-up error arises (AFAIK).

The MSDN forum people say that this pop-up error message can be disabled by SetErrorMode

http://social.msdn.microsoft.com/Forums/vstudio/de-DE/4a6359aa-5604-4d69-9375-08d47a4e9b27/how-do-i-get-rid-of-the-no-disk-error-messagebox-programmatically?forum=vcgeneral

http://social.msdn.microsoft.com/Forums/vstudio/de-DE/7454bccd-abe8-436f-99f5-afae5dcfde5c/how-to-suppress-the-windows-system-message?forum=vcgeneral

SetErrorMode Documentation is here:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621(v=vs.85).aspx

I have no idea about building inkscape under Windows. I assume that this line of code should fix the problem, but I'm not sure where the line should be placed.
setErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);

Revision history for this message
Max Gaukler (mgmax) wrote :

A partial workaround would be changing the internal setting that the recent-files menu does not check if files still exist. But then this annoying message would still appear at other places (just search the bugtracker for "no disk")

inkscape-0.48.4/src/interface.cpp line 974:
    gtk_recent_chooser_set_show_not_found (GTK_RECENT_CHOOSER(recent_menu), FALSE);
-> change to TRUE

Revision history for this message
Max Gaukler (mgmax) wrote :

I found a fix, just one line in main.cpp. Patch is attached.

how to test the bug in a VM:
-winXP virtualbox VM
- add a floppy drive, insert a (virtual) floppy, format it. If you need a floppy image, use this: http://www.codehosting.net/blog/files/blank.img and format it
- Open inkscape (I built from latest trunk myself, should be the same with regular version)
- add some text/element
- save file to floppy
- Close Inkscape
- eject floppy
- reopen inkscape

jazzynico (jazzynico)
Changed in inkscape:
status: Confirmed → Triaged
Revision history for this message
jazzynico (jazzynico) wrote :

Patch tested successfully on Windows XP, Inkscape trunk revision 12865.

Changed in inkscape:
assignee: nobody → Max Gaukler (mgmax)
importance: Undecided → Low
milestone: none → 0.91
status: Triaged → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Committed in the trunk, revision 12866.
Thanks for the patch, Max!

Changed in inkscape:
status: In Progress → Fix Committed
tags: added: backport-proposed
Revision history for this message
Max Gaukler (mgmax) wrote :

if that helps: The same fix as before also works for the 0.48.x series (patch attached). On some systems this bug can get really annoying, I had to click away about 10 such messages at every inkscape start.

Revision history for this message
jazzynico (jazzynico) wrote :

Fix backported to the 0.48.x branch, revision 10008.

Changed in inkscape:
milestone: 0.91 → 0.48.5
tags: removed: backport-proposed
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.