# How to convert .exe for be usable in FreeBSD



## BSDAppentic3 (Mar 1, 2018)

So, i have a program .exe (from windows) that i can't use because of the error of wine.
I have two questions:
1) How to solve this error

```
root@hostfreebsd:~/Downloads # wine fluidsim-5-2b.exe
fixme:gdiplus:GdipGetLineSpacing ignoring style
fixme:wincodecs:JpegDecoder_Frame_CopyPalette (0x13f824,0x139970): stub

Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.OutOfMemoryException: Out of memory
  at (wrapper alloc) System.Object:AllocVector (intptr,intptr)
  at System.Drawing.Icon.InitFromStreamWithSize (System.IO.Stream stream, System.Int32 width, System.Int32 height) [0x004db] in <3110e6dfe53a465e917aa087708d1bb4>:0
  at System.Drawing.Icon..ctor (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) [0x00095] in <3110e6dfe53a465e917aa087708d1bb4>:0
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <1c90db0b17cb4b1e827d577d0607b212>:0
   --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0007a] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0002f] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Reflection.RuntimeConstructorInfo.SerializationInvoke (System.Object target, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject (System.Object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) [0x00059] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.ObjectManager.FixupSpecialObject (System.Runtime.Serialization.ObjectHolder holder) [0x00088] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.ObjectManager.DoFixups () [0x0005a] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize (System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser serParser, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00077] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x000a2] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.ResourceReader.DeserializeObject (System.Int32 typeIndex) [0x00019] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.ResourceReader._LoadObjectV2 (System.Int32 pos, System.Resources.ResourceTypeCode& typeCode) [0x0035c] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.ResourceReader.LoadObjectV2 (System.Int32 pos, System.Resources.ResourceTypeCode& typeCode) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.ResourceReader.LoadObject (System.Int32 pos, System.Resources.ResourceTypeCode& typeCode) [0x00022] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.RuntimeResourceSet.GetObject (System.String key, System.Boolean ignoreCase, System.Boolean isString) [0x000be] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.RuntimeResourceSet.GetObject (System.String key, System.Boolean ignoreCase) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.ResourceManager.GetObject (System.String name, System.Globalization.CultureInfo culture, System.Boolean wrapUnmanagedMemStream) [0x0008e] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.ResourceManager.GetObject (System.String name) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at FluidSIM5Update.MainFormUpd.InitializeComponent () [0x00b24] in <6ec44320dd8f46ab960ff9a29b827724>:0
  at FluidSIM5Update.MainFormUpd..ctor (System.String languageShortcut, System.Collections.Generic.Dictionary`2[TKey,TValue] installedTechs) [0x0002c] in <6ec44320dd8f46ab960ff9a29b827724>:0
  at (wrapper remoting-invoke-with-check) FluidSIM5Update.MainFormUpd:.ctor (string,System.Collections.Generic.Dictionary`2<string, string>)
  at FluidSIM5Update.Program.Main () [0x00280] in <6ec44320dd8f46ab960ff9a29b827724>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.OutOfMemoryException: Out of memory
  at (wrapper alloc) System.Object:AllocVector (intptr,intptr)
  at System.Drawing.Icon.InitFromStreamWithSize (System.IO.Stream stream, System.Int32 width, System.Int32 height) [0x004db] in <3110e6dfe53a465e917aa087708d1bb4>:0
  at System.Drawing.Icon..ctor (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) [0x00095] in <3110e6dfe53a465e917aa087708d1bb4>:0
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <1c90db0b17cb4b1e827d577d0607b212>:0
   --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0007a] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0002f] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Reflection.RuntimeConstructorInfo.SerializationInvoke (System.Object target, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject (System.Object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) [0x00059] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.ObjectManager.FixupSpecialObject (System.Runtime.Serialization.ObjectHolder holder) [0x00088] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.ObjectManager.DoFixups () [0x0005a] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize (System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser serParser, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00077] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x000a2] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.ResourceReader.DeserializeObject (System.Int32 typeIndex) [0x00019] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.ResourceReader._LoadObjectV2 (System.Int32 pos, System.Resources.ResourceTypeCode& typeCode) [0x0035c] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.ResourceReader.LoadObjectV2 (System.Int32 pos, System.Resources.ResourceTypeCode& typeCode) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.ResourceReader.LoadObject (System.Int32 pos, System.Resources.ResourceTypeCode& typeCode) [0x00022] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.RuntimeResourceSet.GetObject (System.String key, System.Boolean ignoreCase, System.Boolean isString) [0x000be] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.RuntimeResourceSet.GetObject (System.String key, System.Boolean ignoreCase) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.ResourceManager.GetObject (System.String name, System.Globalization.CultureInfo culture, System.Boolean wrapUnmanagedMemStream) [0x0008e] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at System.Resources.ResourceManager.GetObject (System.String name) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0
  at FluidSIM5Update.MainFormUpd.InitializeComponent () [0x00b24] in <6ec44320dd8f46ab960ff9a29b827724>:0
  at FluidSIM5Update.MainFormUpd..ctor (System.String languageShortcut, System.Collections.Generic.Dictionary`2[TKey,TValue] installedTechs) [0x0002c] in <6ec44320dd8f46ab960ff9a29b827724>:0
  at (wrapper remoting-invoke-with-check) FluidSIM5Update.MainFormUpd:.ctor (string,System.Collections.Generic.Dictionary`2<string, string>)
  at FluidSIM5Update.Program.Main () [0x00280] in <6ec44320dd8f46ab960ff9a29b827724>:0
```

2) If i couldn't find any solution, can i "translate" the format ".exe" to any format compatible?


----------



## ShelLuser (Mar 1, 2018)

Considering the heavy mention of Mono I suppose you could try lang/mono to see how well that fares. I've been pretty happy with Mono's performance over the years though I mostly use it for C#.NET (web based) stuff.

But other than that you can't really "translate" an executable. It's a binary which has been build for the Windows platform. The only "translation" would be to somehow gain access to its source code and then rebuild it on FreeBSD, but I doubt that's going to work.

Another possible option could be virtualization, but I have no idea how feasible that is. So basically you'd run a full blown Windows environment on top of your FreeBSD setup. For example: emulators/virtualbox-ose. VirtuaBox is just something I happen to be somewhat familiar with, but there are plenty of other alternatives.


----------



## giahung1997 (Mar 1, 2018)

1) It's a .NET related problem. Check if you installed Wine Mono correctly. Or that could be an API not implemented problem on Mono. This case you have to run this App via Virtualization Windows Guest.

2) It's no way to convert a Windows binary to Unix binary or the reverse. If the .exe is actually a .NET App (share the extension but really like java .jar more) you could try run it via Mono (system mono install from pkg, not wine mono). Best regards.


----------



## BSDAppentic3 (Mar 1, 2018)

ShelLuser said:


> Considering the heavy mention of Mono I suppose you could try lang/mono to see how well that fares. I've been pretty happy with Mono's performance over the years though I mostly use it for C#.NET (web based) stuff.
> 
> But other than that you can't really "translate" an executable. It's a binary which has been build for the Windows platform. The only "translation" would be to somehow gain access to its source code and then rebuild it on FreeBSD, but I doubt that's going to work.
> 
> Another possible option could be virtualization, but I have no idea how feasible that is. So basically you'd run a full blown Windows environment on top of your FreeBSD setup. For example: emulators/virtualbox-ose. VirtuaBox is just something I happen to be somewhat familiar with, but there are plenty of other alternatives.



Now i am installing that package. Let's see what happens....


----------



## ralphbsz (Mar 1, 2018)

Best solution: Find the source code; recompile for the operating system you are using.  Yes, it is extra work, but is likely a good investment.


----------



## BSDAppentic3 (Mar 1, 2018)

giahung1997
Another theme ... sorry for the misunderstood.
It is fine if you prefer one operating system instead of another. No problem.
All systems, like all the work dedicated to making them, have something good.
Even Windows, with all its faults and innumerable flaws, is a good operating system. Because it works, its performance does not matter. If you like it, then you must deal with its imperfections.
I have no problem with the operating system you choose, it's your choice. It is not mine election. Just try not to say that "it sucks like desktop system" because we are many users who were successful in using this operating system as a desktop system.


----------



## BSDAppentic3 (Mar 1, 2018)

ralphbsz said:


> Best solution: Find the source code; recompile for the operating system you are using.  Yes, it is extra work, but is likely a good investment.


How?
Where can i find the source code, in the program?
Once i have been access to it, how should i adapt for this system?
You're right: it's extra work. But if the solutions that they told to me does not work, well, I have no choice but to try what you suggest.


----------



## ShelLuser (Mar 1, 2018)

BSDAppentic3 said:


> I have no problem with the operating system you choose, it's your choice. It is not mine election. Just try not to say that "it sucks like desktop system" because we are many users who were successful in using this operating system as a desktop system.


Where the heck did this come from? Looks to me as if you're accusing someone of saying something they didn't. No one said anything about Windows being a suckage in this thread, and even if they did they're still entitled to their own opinion. Also keep in mind that this is a support forum fully centered about FreeBSD. So obviously you'll encounter some bias towards that environment. Just deal with it, trying to start a whole discussion is plain out pointless.



BSDAppentic3 said:


> Where can i find the source code, in the program?
> Once i have been access to it, how should i adapt for this system?


You can't. If you have an executable then you obviously don't automatically have access to its source code. Unless of course you're working with an open source program, that basically guarantees the availability of the source code. Just keep in mind that even that is by no means a guarantee that you'll actually be able to compile it.

I did a quick lookup and FluidSIM is commercial software, so there's no way they'd give you access to their code 

Some solutions have been mentioned above, the other is to find software native for FreeBSD. If it's circuit design you're after then software like this is also available through the ports collection. A mere `make search key=circuit` in /usr/ports already shows me stuff such as cad/cider, cad/linux-eagle5 and several others. Obviously I don't know how well these compare, but it could provide a suitable alternative.

If you're using binary packages you might want to try: `pkg search --comments circuit`.


----------



## ralphbsz (Mar 1, 2018)

BSDAppentic3 said:


> How?
> Where can i find the source code, in the program?
> Once i have been access to it, how should i adapt for this system?


In general, this question is such low level that answering it in a sensible fashion is actually difficult.  All software has source code.  Open source software is by definition such that you can obtain the source code (although it is not always easy).  Commercial software sometimes comes with or as source code, usually not.  Most software has a copyright or a license (there are some very rare cases of truly free software, which are released into the public domain).  That copyright or license restricts what you can do with the software, or its source code.

The source code is hardly ever stored in the program.  It is sometimes shipped with the program.

ShelLuser already answered part of that question: You seem to be using the commercial FluidSim software package.  Someone somewhere must have bought a license to that package, and that's probably how they received the executable.  You could ask that person what the license says, and whether it came with source code.  It is quite possible (even likely) that the license has restrictions, for example that you are only allowed to use this software on a certain number of computers (probably 1), and only on the operating system for which it was intended.  It is quite possible that by trying to run it on FreeBSD (perhaps with Wine in the middle), you are violating that license.  In that case, you would be doing something illegal, and if we helped you, we would be parts of that illegal action.  Which means that until you explain more what is going on, you are unlikely to actually receive help here.

If on the other hand you have a copy of the source code, and need help making it compile and run on FreeBSD, that is at least theoretically a solvable problem.  How difficult it is depends on how it is implemented.  It might take a few minutes of work, if it is written in a well-portable language (like Java) using only common libraries; it might require just a few adjustments to the make file.  That doesn't seem to be the case here, since it does seem to use Mono.  It might also take a completely rewrite, if the software design is closely tied into the Windows style of programming.  Before we give you concrete advice, we need more information.


----------



## BSDAppentic3 (Mar 1, 2018)

ralphbsz said:


> In general, this question is such low level that answering it in a sensible fashion is actually difficult.  All software has source code.  Open source software is by definition such that you can obtain the source code (although it is not always easy).  Commercial software sometimes comes with or as source code, usually not.  Most software has a copyright or a license (there are some very rare cases of truly free software, which are released into the public domain).  That copyright or license restricts what you can do with the software, or its source code.
> 
> The source code is hardly ever stored in the program.  It is sometimes shipped with the program.
> 
> ...



Explain me something that i couldn't understand: you're saying that if use that program with wine in this platform, i am making something illegal?


----------



## BSDAppentic3 (Mar 1, 2018)

ShelLuser said:


> Where the heck did this come from? Looks to me as if you're accusing someone of saying something they didn't. No one said anything about Windows being a suckage in this thread, and even if they did they're still entitled to their own opinion. Also keep in mind that this is a support forum fully centered about FreeBSD. So obviously you'll encounter some bias towards that environment. Just deal with it, trying to start a whole discussion is plain out pointless.
> 
> 
> You can't. If you have an executable then you obviously don't automatically have access to its source code. Unless of course you're working with an open source program, that basically guarantees the availability of the source code. Just keep in mind that even that is by no means a guarantee that you'll actually be able to compile it.
> ...



Sorry, but you know why i am trying to use this *specific* program? It's an emulator of circuits electro-pneumatics. Not an emulator of circuits *electronics* nor even electrics.

Until the day of today, i haven't been found something similar even in Linux.

Maybe i haven't search enough. Or maybe there's no something alike that, outside of Windows of course.


----------



## BSDAppentic3 (Mar 1, 2018)

ShelLuser
The second point it's about a message that i have sent to that user. It was because he was saying, well, better read it for yourself:
https://forums.freebsd.org/threads/missing-font-issues-with-libreoffice.64850/#post-379199
But it doesn't matter, it has nothing to do with this topic.
Edit: sorry, i don't know other way for post links to another thread. But as i said, it doesn't matter. Everything's okay. And if i mentioned Windows, it was because *just to quote an example*. Like if i had mentioned Linux.


----------



## BSDAppentic3 (Mar 1, 2018)

ralphbsz 
Ah, i catch it.
I remember that edit the code of a program of privative or commercial software it's illegal.
That's what you mean?


----------



## BSDAppentic3 (Mar 1, 2018)

So, if i want to run this software, then first i need to read their license?
So if i try to run it with Wine, i am doing something illegal?


----------



## flipper_88 (Mar 1, 2018)

Maybe even a custom compile of emulators/wine or even a source port orf crossover o0ffice.


----------



## ralphbsz (Mar 1, 2018)

BSDAppentic3 said:


> Explain me something that i couldn't understand: you're saying that if use that program with wine in this platform, i am making something illegal?


The software you bought came with a license, which typically has some restrictions.  For example, in the old days when you bought a Microsoft Windows license, you were only allowed to run it on *one* computer, not two; installing a second copy of it using VMware was a violation of the license itself. (Whether uninstalling it from the first computer, then installing it on different one, perhaps under VMware was legal or not depended on the details, which I don't know).  And the license is written so that once you violate it, it becomes invalid, and now you are running unlicensed software.  A different example is the license we have at home for Microsoft Office for the Mac: It explicitly says that you can run it concurrently on up to 3 computers.  Let's see, my laptop, my son's old laptop, and his new one; fortunately, the even older Macbook air is completely dead (pouring water over it was in retrospect a bad idea): exactly 3 computers, we're good.

The first step has to be: Find and read the license.

Now, if you have a licensed copy, and you are running it only on one computer (this time under Wine instead of on native windows), you're probably OK.  But you should still check.



> I remember that edit the code of a program of privative or commercial software it's illegal.


It's complicated.  In the US, there are some clauses in the DMCA law that may make decompiling or modifying licensed software illegal, but that is a terribly complex and grey area.  If you were given the source code, it must have come with a license.  For commercial software (where you pay for the license, not just for support), those licenses typically have a prohibition against modifying or sharing the code with others; actually commercially licensed software is only rarely shipped with source code.  For open source software, there is nearly always a license attached, which in nearly all cases allows you to modify the code, at least enough to make it work on other platforms.

This is an area where there are no simply "yes - no" answers.  Ever.

I just looked up the web site for FluidSim 5.  There are commercial licenses, and they are expensive enough that the ordering web site doesn't tell us the price, and you need to request a quotation.  Probably thousands, since quotations aren't done for cheap stuff.  There are different types of licenses, for a single computer, for a network, and for different numbers of users.  There is a student license for educational institutions for 59.50 Euro.  And there is a free demo version, which is only allowed to be used for 30 days, and then for 30 minutes of runtime.  Clearly, this is complicated.

Allow me to ask a question: Wouldn't it be easier to just run this on Windows, instead of investing all the time to fight with Wine?


----------



## BSDAppentic3 (Mar 2, 2018)

> Allow me to ask a question: Wouldn't it be easier to just run this on Windows, instead of investing all the time to fight with Wine?



Well, again, Wine gave me an error:


```
root@hostfreebsd:~/Downloads # wine fluidsim-5-2b.exe
fixme:gdiplus:GdipGetLineSpacing ignoring style
fixme:wincodecs:JpegDecoder_Frame_CopyPalette (0x13f814,0x139960): stub

Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.OutOfMemoryException: Out of memory
  at (wrapper alloc) System.Object:AllocVector (intptr,intptr)
  at System.Drawing.Icon.InitFromStreamWithSize (System.IO.Stream stream, System.Int32 width, System.Int32 height) [0x004db] in <3110e6dfe53a465e917aa087708d1bb4>:0 
  at System.Drawing.Icon..ctor (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) [0x00095] in <3110e6dfe53a465e917aa087708d1bb4>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <1c90db0b17cb4b1e827d577d0607b212>:0 
   --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0007a] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0002f] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Reflection.RuntimeConstructorInfo.SerializationInvoke (System.Object target, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject (System.Object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) [0x00059] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.ObjectManager.FixupSpecialObject (System.Runtime.Serialization.ObjectHolder holder) [0x00088] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.ObjectManager.DoFixups () [0x0005a] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize (System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser serParser, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00077] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x000a2] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.ResourceReader.DeserializeObject (System.Int32 typeIndex) [0x00019] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.ResourceReader._LoadObjectV2 (System.Int32 pos, System.Resources.ResourceTypeCode& typeCode) [0x0035c] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.ResourceReader.LoadObjectV2 (System.Int32 pos, System.Resources.ResourceTypeCode& typeCode) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.ResourceReader.LoadObject (System.Int32 pos, System.Resources.ResourceTypeCode& typeCode) [0x00022] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.RuntimeResourceSet.GetObject (System.String key, System.Boolean ignoreCase, System.Boolean isString) [0x000be] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.RuntimeResourceSet.GetObject (System.String key, System.Boolean ignoreCase) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.ResourceManager.GetObject (System.String name, System.Globalization.CultureInfo culture, System.Boolean wrapUnmanagedMemStream) [0x0008e] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.ResourceManager.GetObject (System.String name) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at FluidSIM5Update.MainFormUpd.InitializeComponent () [0x00b24] in <6ec44320dd8f46ab960ff9a29b827724>:0 
  at FluidSIM5Update.MainFormUpd..ctor (System.String languageShortcut, System.Collections.Generic.Dictionary`2[TKey,TValue] installedTechs) [0x0002c] in <6ec44320dd8f46ab960ff9a29b827724>:0 
  at (wrapper remoting-invoke-with-check) FluidSIM5Update.MainFormUpd:.ctor (string,System.Collections.Generic.Dictionary`2<string, string>)
  at FluidSIM5Update.Program.Main () [0x00280] in <6ec44320dd8f46ab960ff9a29b827724>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.OutOfMemoryException: Out of memory
  at (wrapper alloc) System.Object:AllocVector (intptr,intptr)
  at System.Drawing.Icon.InitFromStreamWithSize (System.IO.Stream stream, System.Int32 width, System.Int32 height) [0x004db] in <3110e6dfe53a465e917aa087708d1bb4>:0 
  at System.Drawing.Icon..ctor (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) [0x00095] in <3110e6dfe53a465e917aa087708d1bb4>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <1c90db0b17cb4b1e827d577d0607b212>:0 
   --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0007a] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0002f] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Reflection.RuntimeConstructorInfo.SerializationInvoke (System.Object target, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject (System.Object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) [0x00059] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.ObjectManager.FixupSpecialObject (System.Runtime.Serialization.ObjectHolder holder) [0x00088] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.ObjectManager.DoFixups () [0x0005a] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize (System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser serParser, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00077] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x000a2] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.ResourceReader.DeserializeObject (System.Int32 typeIndex) [0x00019] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.ResourceReader._LoadObjectV2 (System.Int32 pos, System.Resources.ResourceTypeCode& typeCode) [0x0035c] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.ResourceReader.LoadObjectV2 (System.Int32 pos, System.Resources.ResourceTypeCode& typeCode) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.ResourceReader.LoadObject (System.Int32 pos, System.Resources.ResourceTypeCode& typeCode) [0x00022] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.RuntimeResourceSet.GetObject (System.String key, System.Boolean ignoreCase, System.Boolean isString) [0x000be] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.RuntimeResourceSet.GetObject (System.String key, System.Boolean ignoreCase) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.ResourceManager.GetObject (System.String name, System.Globalization.CultureInfo culture, System.Boolean wrapUnmanagedMemStream) [0x0008e] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at System.Resources.ResourceManager.GetObject (System.String name) [0x00000] in <1c90db0b17cb4b1e827d577d0607b212>:0 
  at FluidSIM5Update.MainFormUpd.InitializeComponent () [0x00b24] in <6ec44320dd8f46ab960ff9a29b827724>:0 
  at FluidSIM5Update.MainFormUpd..ctor (System.String languageShortcut, System.Collections.Generic.Dictionary`2[TKey,TValue] installedTechs) [0x0002c] in <6ec44320dd8f46ab960ff9a29b827724>:0 
  at (wrapper remoting-invoke-with-check) FluidSIM5Update.MainFormUpd:.ctor (string,System.Collections.Generic.Dictionary`2<string, string>)
  at FluidSIM5Update.Program.Main () [0x00280] in <6ec44320dd8f46ab960ff9a29b827724>:0
```

So, considering this, and the fact about the license, i think that i will try to create a VM of Windows.


----------



## BSDAppentic3 (Mar 2, 2018)

ralphbsz 
Do you know how can i mount an ext2 partition?
Because i have the .iso of windows 8 in one of this kind. In fact, i tried with wine because i can't mount that partition.


----------



## ralphbsz (Mar 2, 2018)

About that second long error above: If you read it, it is an out of memory error.  Either the wine environment really does not have enough memory for this program (possible, but implausible), or running this program under wine causes bugs that end up masquarading as out of memory.

How to mount ext2 on FreeBSD: Look at the FreeBSD handbook chapter 20: Linux file systems, it should be very easy.


----------



## BSDAppentic3 (Mar 2, 2018)

ralphbsz said:


> About that second long error above: If you read it, it is an out of memory error.  Either the wine environment really does not have enough memory for this program (possible, but implausible), or running this program under wine causes bugs that end up masquarading as out of memory.
> 
> How to mount ext2 on FreeBSD: Look at the FreeBSD handbook chapter 20: Linux file systems, it should be very easy.



Well, it was easy. Well, not so. Maybe i need read about the filesystem on FBSD.
But following that command, i can't. Until i wrote:

```
gpart list
```
, which shows me the name of the partition. It fails because i was trying like its name was 
	
	



```
da1
```
 when the name that i saw in the previous command was 
	
	



```
da1s2
```
Like here:

```
root@hostfreebsd:~ # gpart list
Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 1953525134
first: 40
entries: 152
scheme: GPT
Providers:
1. Name: ada0p1
   Mediasize: 524288 (512K)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 23226a57-06ad-11e8-b6e7-7085c24e6955
   rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
   label: (null)
   length: 524288
   offset: 20480
   type: freebsd-boot
   index: 1
   end: 1063
   start: 40
2. Name: ada0p2
   Mediasize: 996431884288 (928G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   rawuuid: 2322e932-06ad-11e8-b6e7-7085c24e6955
   rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 996431884288
   offset: 544768
   type: freebsd-ufs
   index: 2
   end: 1946157087
   start: 1064
3. Name: ada0p3
   Mediasize: 3772435968 (3.5G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e0
   rawuuid: 236be95c-06ad-11e8-b6e7-7085c24e6955
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 3772435968
   offset: 996432429056
   type: freebsd-swap
   index: 3
   end: 1953525126
   start: 1946157088
Consumers:
1. Name: ada0
   Mediasize: 1000204886016 (932G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r2w2e3

Geom name: da1
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 60768255
first: 63
entries: 4
scheme: MBR
Providers:
1. Name: da1s2
   Mediasize: 31112298496 (29G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 1048576
   Mode: r0w0e0
   rawtype: 131
   length: 31112298496
   offset: 1048576
   type: linux-data
   index: 2
   end: 60768255
   start: 2048
Consumers:
1. Name: da1
   Mediasize: 31113347072 (29G)
   Sectorsize: 512
   Mode: r0w0e0

Geom name: diskid/DISK-00400539BC5BBDC1873D005A
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 60768255
first: 63
entries: 4
scheme: MBR
Providers:
1. Name: diskid/DISK-00400539BC5BBDC1873D005As2
   Mediasize: 31112298496 (29G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 1048576
   Mode: r0w0e0
   rawtype: 131
   length: 31112298496
   offset: 1048576
   type: linux-data
   index: 2
   end: 60768255
   start: 2048
Consumers:
1. Name: diskid/DISK-00400539BC5BBDC1873D005A
   Mediasize: 31113347072 (29G)
   Sectorsize: 512
   Mode: r0w0e0
```
It was because of the "s", right? Because of the initial of "slice", which it would come to be the name given in FBSD to a partition. But i don't have very clear: which it's the difference between "slice" and partition? The handbook speaks about it, right?


----------



## BSDAppentic3 (Mar 2, 2018)

Anyways, the VMs of windows that I could to create did not last long.
You know the windows failures, right? those that show you "your system has suffered a failure" or something like that, and show you the percentage of the system recovery in big numbers. For "big numbers" i mean something like this:


----------



## BSDAppentic3 (Mar 2, 2018)

Well, something alike but showing a percentage instead of the sadly face.
Well, the trouble with those VMs, was that... look, when i shutted down the VM, the system didn't have any "persistence" (what means that if i started again the VM, i needed to install thw whole system again)


----------

