[Geany-Devel] Windows GTK Runtime 2.24 and config directory

Enrico Tröger enrico.troeger at xxxxx
Sun Aug 31 14:38:18 UTC 2014


On 30/08/14 03:04, Matthew Brush wrote:
> On 14-08-29 07:24 AM, Enrico Tröger wrote:
>> [snip]
>>>> I'd implement this way first, based on your patch, and if we want, we
>>>> can change to .../Local later anyway if desired.
>>>>
>>>
>>> I think it's probably the easiest solution, with the least code, and
>>> most compatibility. If you don't feel like coding it yourself, let me
>>> know and I can whip up a (real/working) function to do it. I've been
>>> doing a fair bit of Win32 API coding lately so it's fresh on my mind, I
>>
>> I don't mind, if you like to do it, I'd be happy to test the result :).
>>
> 
> Attached is a function that works standalone, it could drop into the
> previous patch where the untested/working function was. I have only
> tested on WinXP. If you don't feel like putting it together manually, I
> can eventually commit it all together properly once I figure out my
> build system issues.

Tested on Windows 7:

I had to change the function to its multibyte variant:

SHGetFolderPathAndSubDirW

Otherwise it spat out compiler warnings and the resulting config
directory was:

 㩃啜敳獲敜牮捩屯灁䑰瑡屡潒浡湩屧g旄

:).


Additionally, I had to add the flag CSIDL_FLAG_CREATE so that the
...\Roaming\geany folder is created initially if it doesn't exist yet.
Without that flag, SHGetFolderPathAndSubDirW() would fail if the folder
doesn't exist.
Alternatively we could maybe use the flag CSIDL_FLAG_DONT_VERIFY since
we create the folder in Geany at a later point anyway. Though I didn't
test this flag because I guess it's better if Windows creates this
special folder.

Attached is the trivial diff of my changes to your confdir.c.

So, if my modifications work also on your Windows XP, I'd say go ahead
and commit your changes and I will start to build the installer.

Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: confdir.diff
Type: text/x-patch
Size: 451 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20140831/321453a5/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.geany.org/pipermail/devel/attachments/20140831/321453a5/attachment.sig>


More information about the Devel mailing list