[PATCH SET] Port to windows

83 views
Skip to first unread message

Ankit Jain

unread,
Jan 19, 2009, 3:03:23 PM1/19/09
to giver...@googlegroups.com, calv...@gmail.com
Attached are 6 patches which together allow giver to run on windows
and mac too (should be easy to get that now).
The patches move the platform specific bits into a separate *PlatformService
and *DesktopApplication types.

- For system tray stuff, Gtk.StatusIcon is used now instead of
Egg.TrayIcon

- One of the problems i faced was - notification, since i AFAICS
notify-sharp doesn't work on windows. So, till the time a proper
solution is found and implemented, I'm using Gtk.Dialog instead
of notification on windows.
Instead of handling any kinda dialog with multiple buttons and
actions, I'm using a YesNo style dialog, which suits the current
needs. This can ofcourse be changed later when the need
arises.

- Another problem was i18n: on windows, the same (english)
string is used. This should probably be replaced with using
string resources, but i haven't explored that as yet.

- Also, a --enable-windows arg has to been added to configure.

The patches should be applied in the order of their numbering.

For running on windows,
1. build with --enable-windows
2. You'll need Mono.Zeroconf.dll and Mono.Zeroconf.Providers.Bonjour.dll
3. Ensure that bonjour is installed

Please give feedback on the patches and test it out and lemme
know if you hit any problems.

Thanks,
-Ankit
--
Blog : http://www.ankitjain.org/blog

0001-Abstract-out-platform-specific-bits.patch
0002--Application.cs-Use-Gtk.StatusIcon-instead-of-Egg.patch
0003-Move-i18n-and-sound-stuff-to-PlatformService.patch
0004--configure.ac-Add-a-enable-windows-option.patch
0005--src-Logger.cs-Use-SpecialFolder.Personal-instead.patch
0006-Abstract-out-notification-api.patch

Aqeel Zafar (aqeeliz)

unread,
Jan 19, 2009, 9:18:57 PM1/19/09
to Giver Project
Here is what I get when I apply patch 0004:

patching file ChangeLog
patching file configure.ac
patching file src/Makefile.am
Hunk #2 FAILED at 18.
Hunk #3 FAILED at 36.
Hunk #4 succeeded at 43 (offset -7 lines).
2 out of 4 hunks FAILED -- saving rejects to file src/Makefile.am.rej

I am using latest svn (rev 94).
>  0001-Abstract-out-platform-specific-bits.patch
> 32KViewDownload
>
>  0002--Application.cs-Use-Gtk.StatusIcon-instead-of-Egg.patch
> 8KViewDownload
>
>  0003-Move-i18n-and-sound-stuff-to-PlatformService.patch
> 17KViewDownload
>
>  0004--configure.ac-Add-a-enable-windows-option.patch
> 3KViewDownload
>
>  0005--src-Logger.cs-Use-SpecialFolder.Personal-instead.patch
> 1KViewDownload
>
>  0006-Abstract-out-notification-api.patch
> 16KViewDownload

Ankit Jain

unread,
Jan 19, 2009, 11:47:24 PM1/19/09
to giver...@googlegroups.com
As I had mentioned in my mail, you need to apply all the patches
and _in order_. So, start with 0001, then 0002.. and so on.
They apply fine on r94.

-Ankit
--
Blog : http://www.ankitjain.org/blog

Aqeel Zafar

unread,
Jan 20, 2009, 1:10:20 AM1/20/09
to giver...@googlegroups.com
Ankit,

I did apply all patches in correct order, but I think my source wasn't
exactly r94, I guess I had forgotten I have edited few files. Works
fine on r94. Sorry for false alarm.

Thanks
--
Aqeel Zafar
http://aqeeliz.com

Ankit Jain

unread,
Jan 20, 2009, 1:12:44 AM1/20/09
to giver...@googlegroups.com
Np :) Lemme know if you hit any problems.

-Ankit
--
Blog : http://www.ankitjain.org/blog

Jerzy

unread,
Jan 21, 2009, 10:28:07 AM1/21/09
to Giver Project
Wow! That would be amazing to see Giver working in Windows!

Are there any screenshots? And some ready binaries?

Thanks in advance!

Ankit Jain

unread,
Jan 21, 2009, 11:36:05 AM1/21/09
to giver...@googlegroups.com
i'll post screenshots in a short while. Binaries for testing:
www.ankitjain.org/blog/giver-on-windows

Would useful to get info on whether it works for you or not.

-ankit
--
Sent from my mobile device

Blog : http://www.ankitjain.org/blog

Aqeel Zafar (aqeeliz)

unread,
Jan 21, 2009, 11:47:21 AM1/21/09
to Giver Project
Ankit:

1. Not sure if this is important or not, but on linux, I can see my
own computer in giver too, whereas in windows I couldn't. It only
showed other computer.

2. I could send file from windows to linux, but not from linux to
windows.

3. Is there any way to run giver without having a terminal window open
with it too?

That's pretty much all for now.

Regards.

P.S : I did install gtk-sharp and bonjour. :)

On Jan 21, 9:36 pm, Ankit Jain <radi...@gmail.com> wrote:
> i'll post screenshots in a short while. Binaries for testing:www.ankitjain.org/blog/giver-on-windows
>
> Would useful to get info on whether it works for you or not.
>
> -ankit
>

Sandy Armstrong

unread,
Jan 21, 2009, 11:58:18 AM1/21/09
to giver...@googlegroups.com
On 01/21/2009 08:47 AM, Aqeel Zafar (aqeeliz) wrote:
> 3. Is there any way to run giver without having a terminal window open
> with it too?

Probably forgot to build Giver with a winexe target.

Sandy

Ankit Jain

unread,
Jan 21, 2009, 3:18:02 PM1/21/09
to giver...@googlegroups.com
> 1. Not sure if this is important or not, but on linux, I can see my
> own computer in giver too, whereas in windows I couldn't. It only
> showed other computer.

Will check this out sometime.

> 2. I could send file from windows to linux, but not from linux to
> windows.

Working on this now.

> 3. Is there any way to run giver without having a terminal window open
> with it too?

As Sandy said, compile it as winexe. I'll fix this in patch that i'll commit.

> That's pretty much all for now.

Thanks for the feedback :)

-Ankit
>
> Regards.
>
> P.S : I did install gtk-sharp and bonjour. :)
>
> On Jan 21, 9:36 pm, Ankit Jain <radi...@gmail.com> wrote:
>> i'll post screenshots in a short while. Binaries for testing:www.ankitjain.org/blog/giver-on-windows
>>
>> Would useful to get info on whether it works for you or not.
>>
>> -ankit
>>
>> On 1/21/09, Jerzy <jerzyglowa...@gmail.com> wrote:
>>
>>
>>
>> > Wow! That would be amazing to see Giver working in Windows!
>>
>> > Are there any screenshots? And some ready binaries?
>>
>> > Thanks in advance!
>>
>> --
>> Sent from my mobile device
>>
>> Blog :http://www.ankitjain.org/blog
> >
>



--
Blog : http://www.ankitjain.org/blog

Ankit Jain

unread,
Jan 21, 2009, 3:19:31 PM1/21/09
to giver...@googlegroups.com

Ankit Jain

unread,
Jan 21, 2009, 4:40:38 PM1/21/09
to giver...@googlegroups.com
Hi,

> 2. I could send file from windows to linux, but not from linux to
> windows.

Fixed.

> 3. Is there any way to run giver without having a terminal window open
> with it too?

Fixed.

Try the updated zip file : www.ankitjain.org/blog/giver-windows.zip

ankit

unread,
Jan 21, 2009, 7:33:44 PM1/21/09
to Giver Project
Committed to svn.

-Ankit

Aqeel Zafar

unread,
Jan 21, 2009, 9:00:44 PM1/21/09
to giver...@googlegroups.com
Thanks for the update.
The link you mentioned is 404, I downloaded from previous link (
http://www.ankitjain.org/giver-windows.zip ), which seem to have
updated binary as there is no giver.exe.mdf in it, and it doesn't open
terminal window while executing.

2. This issue is still not resolved, at least not for me. I still
can't receive file on windows.

ankit

unread,
Jan 22, 2009, 8:28:28 AM1/22/09
to Giver Project
> The link you mentioned is 404, I downloaded from previous link (http://www.ankitjain.org/giver-windows.zip), which seem to have
> updated binary as there is no giver.exe.mdf in it, and it doesn't open
> terminal window while executing.

Oops, typo in the url. the url that you used is the correct one.

> 2. This issue is still not resolved, at least not for me. I still
> can't receive file on windows.

Oh? I tried that zip again and it works fine for me.
What error do you get? Still a "user has declined" .. or something
else ?
Can you also attach the .giver.log from your "My Documents" folder ?

-Ankit

Aqeel Zafar

unread,
Jan 23, 2009, 1:51:26 AM1/23/09
to giver...@googlegroups.com
>> 2. This issue is still not resolved, at least not for me. I still
>> can't receive file on windows.
>
> Oh? I tried that zip again and it works fine for me.
> What error do you get? Still a "user has declined" .. or something
> else ?

Actually, when I send file from linux to windows, nothing happens,
there is no error message or anything at either side. It seems like I
haven't initiated any action.

> Can you also attach the .giver.log from your "My Documents" folder ?

I am not near my PC right now, I will attach it soon. BTW there is no
entry about any file being received (or not received), only about file
being sent.

Ankit Jain

unread,
Jan 23, 2009, 4:33:36 AM1/23/09
to giver...@googlegroups.com
Hi,

> Actually, when I send file from linux to windows, nothing happens,
> there is no error message or anything at either side. It seems like I
> haven't initiated any action.

Do you have a firewall enabled on your windows box? Does the request
from linux get timed out ?

Aqeel Zafar

unread,
Jan 25, 2009, 3:29:25 AM1/25/09
to giver...@googlegroups.com
Hey,

>> Actually, when I send file from linux to windows, nothing happens,
>> there is no error message or anything at either side. It seems like I
>> haven't initiated any action.
>
> Do you have a firewall enabled on your windows box? Does the request
> from linux get timed out ?

No, I am not using any firewall on either machine, though, windows has
it's default firewall enabled, from which I unblocked giver, when I
first ran it. And I don't see anything on linux either, just as I said
in my previous email, it seem like no action has been initiated here.

Ankit Jain

unread,
Jan 25, 2009, 4:09:03 AM1/25/09
to giver...@googlegroups.com
AFAIK, just "unblocking" giver by adding it to exceptions won't help.
You need to add the port that your instance of giver is listening to,
to the exceptions in the firewall.

Keep in mind that giver will probably use a different port on every
instance. I plan on adding an option to use a fixed port, this week.

-Ankit
--
Blog : http://www.ankitjain.org/blog

Jerzy

unread,
Jan 26, 2009, 5:12:35 AM1/26/09
to Giver Project
On 25 Sty, 10:09, Ankit Jain <radi...@gmail.com> wrote:
> AFAIK, just "unblocking" giver by adding it to exceptions won't help.
> You need to add the port that your instance of giver is listening to,
> to the exceptions in the firewall.

Yes, I noticed it too. When I unblock Giver.exe in Windows XP
Firewall, I still cannot send files to my neighbour with Windows XP.
When I disable Windows Firewalls in both PCs, it goes.

> Keep in mind that giver will probably use a different port on every
> instance. I plan on adding an option to use a fixed port, this week.
>
> -Ankit

Thank you once more Ankit! Good job!

Jerzy

unread,
Jan 26, 2009, 5:13:55 AM1/26/09
to Giver Project
And a couple of questions:

1. Is it possible to run Giver for Windows without Bonjour? Or using
UPnP built in
Windows?
2. Will there be any bundled version with the installer?
3. How to run giver.exe minimized at the Windows startup?

mzehrer

unread,
Jan 27, 2009, 5:24:06 AM1/27/09
to Giver Project
Hi,

I tried the binaries from http://ankitjain.org/blog/giver-on-windows/
on an Vista 64bit and Giver crashes directly on startup, I don't see
any Windows from Giver just the Windows "program does not work.."
message.

Best, Michael

Aqeel Zafar (aqeeliz)

unread,
Feb 4, 2009, 3:34:28 AM2/4/09
to Giver Project
> AFAIK, just "unblocking" giver by adding it to exceptions won't help.
> You need to add the port that your instance of giver is listening to,
> to the exceptions in the firewall.
>
> Keep in mind that giver will probably use a different port on every
> instance. I plan on adding an option to use a fixed port, this week.

Any updates? :)

And in case I haven't said that before, thanks for the windows port.

Regards
Aqeel

Yavor

unread,
Feb 10, 2009, 1:45:24 PM2/10/09
to Giver Project
Great job on making Giver multi-platform, Ankit! However, I would
advise using native UI, e.g. Winforms (I'll actually try to do that
and post patches, if possible)

I also plan to try using Cocoa# as another UI front-end, that's why I
advocate using native UI where possible.

Yavor

Ankit Jain

unread,
Feb 10, 2009, 2:49:20 PM2/10/09
to giver...@googlegroups.com
On Wed, Feb 4, 2009 at 2:04 PM, Aqeel Zafar (aqeeliz)
<good...@gmail.com> wrote:
>
>> AFAIK, just "unblocking" giver by adding it to exceptions won't help.
>> You need to add the port that your instance of giver is listening to,
>> to the exceptions in the firewall.
>>
>> Keep in mind that giver will probably use a different port on every
>> instance. I plan on adding an option to use a fixed port, this week.
>
> Any updates? :)

I was unable to work on this before I left for my 2 week vacation. I'll be able
to do this now only next week. I have some more fixes lined up.

> And in case I haven't said that before, thanks for the windows port.

Thanks :)

>
> Regards
> Aqeel
> >
>



--
Blog : http://www.ankitjain.org/blog

Ankit Jain

unread,
Feb 10, 2009, 2:51:49 PM2/10/09
to giver...@googlegroups.com
On Wed, Feb 11, 2009 at 12:15 AM, Yavor <feale...@gmail.com> wrote:
>
> Great job on making Giver multi-platform, Ankit! However, I would
> advise using native UI, e.g. Winforms (I'll actually try to do that
> and post patches, if possible)

Yeah, native UIs would be nice, but not so urgent. And patches are always
welcome ;)

> I also plan to try using Cocoa# as another UI front-end, that's why I
> advocate using native UI where possible.

Okay.

-Ankit
>
> Yavor
> >
>



--
Blog : http://www.ankitjain.org/blog

Yavor

unread,
Feb 10, 2009, 4:31:26 PM2/10/09
to Giver Project
Well, right now I'm working on severing the GTK stuff (My biggest
grief is having to using System.Drawing.Image for photos, and then do
conversion to Gtk.Image and Cocoa.NSImage via streams, but ah
well... :-D) into a separate class, which has become a real breeze
with your work, Ankit. I'll see if I can upload something by the end
of the week. Hopefully my professors won't go bonkers with assignments
for the weekend.

Peace,
Yavor

Yavor

unread,
Feb 13, 2009, 10:40:42 PM2/13/09
to Giver Project
I have a working Winforms Giver, but without the Preferences and About
dialogs and progress bars. Well, I have progress bars, but I want to
implement TransferProgress for RequestHandler so that we can have
progress for sending and receiving. Everything else is working, though
I couldn't test Gravatar. I also have to figure out a way to implement
cancellation of a running transfer from either side. I'm afraid I
shuffled the code too much to separate the business logic enough so
that we can have independent guis. I'm not experienced with gtk#, so
anyone who's willing to help me get the gtk code working again will be
much appreciated. I'd have posted a patch, but I went and documented a
very large part of the code, aside from all the other changed I've
made, so it'd be a great big patch. If anyone's interested in an
archive of the source, please let me know. You can contact me on
#giver @ irc.gnome.org. My nick is fealebenpae.

Yavor

unread,
Feb 14, 2009, 12:52:08 PM2/14/09
to Giver Project
On http://home.aubg.bg/students/ysg080/giver/ you can find copies of
my binaries and source. The only things missing right now are the
Preferences and About box, but those are trivial. Right now it can
send and receive files and folders, even when using current giver
instances. Also the windows firewall is no longer a problem - on
startup giver ads a port exception and removes it on shutdown. But I
still haven't made inbound transfer progress events possible and the
graceful cancellation of an active transfer.

I've split Giver in three assemblies - Giver.Core, which houses all
the business logic, Giver.Windows and Giver.exe. The last just calls
Giver.Core to determine the environment and tries to load either
Giver.Windows, Giver.Gnome or Giver.Cocoa through reflection.

Please let me know what you think.
Reply all
Reply to author
Forward
0 new messages