+ }
+ else
+ {
+ // key already exists, maybe we want to change it ??
+ if (!filetypeOrig.empty())
+ {
+ filetype = filetypeOrig;
+ key.SetValue(wxEmptyString, filetype);
+ }
+ else
+ {
+ key.QueryValue(wxEmptyString, filetype);
+ }
+ }
+
+ // now set a mimetypeif we have it, but ignore it if none
+ const wxString& mimetype = ftInfo.GetMimeType();
+ if ( !mimetype.empty() )
+ {
+ // set the MIME type
+ ok = key.SetValue(_T("Content Type"), mimetype);
+
+ if ( ok )
+ {
+ // create the MIME key
+ wxString strKey = MIME_DATABASE_KEY;
+ strKey << mimetype;
+ wxRegKey keyMIME(wxRegKey::HKCR, strKey);
+ ok = keyMIME.Create();
+
+ if ( ok )
+ {
+ // and provide a back link to the extension
+ keyMIME.SetValue(_T("Extension"), extWithDot);
+ }
+ }
+ }
+
+
+ // now make other extensions have the same filetype
+
+ for (iExtCount=1; iExtCount < ftInfo.GetExtensionsCount(); iExtCount++ )
+ {
+ ext = ftInfo.GetExtensions()[iExtCount];
+ if ( ext[0u] != _T('.') )
+ extWithDot = _T('.');
+ extWithDot += ext;