mapwindow on deployment machine

Jan 12, 2016 at 3:26 PM
Edited Jan 18, 2016 at 11:46 AM
Build from VS express is OK and mapwindow.exe is running OK. But when I copy debug folder to working machine with Windows 10 there is no way to run mapwidow.exe:
"mapwindow V5 Core binaries has stopped working". OCX here is not registed as you wrote on this forum.
Am I missed something? Please for help!
Regards, Vojo
Coordinator
Jan 12, 2016 at 8:43 PM
You need to compile for release. Then some additional tasks are run.
Then you should have bin folder with all the necessary files.
Jan 13, 2016 at 8:36 AM
Now compiling in Release mode (also with turned off compiling the postbuild project) throw an error message:
"Error 343 The command "if Release == Release postbuild.bat" exited with code 1. MW5"!
Coordinator
Jan 13, 2016 at 9:37 AM
In my setup I have the postbuild project enabled. Perhaps you should try it.
The postbuild.bat is calling MW5.PostBuild.exe and if you don't build it you don't have it.
Jan 13, 2016 at 10:04 AM
sorry, i was not clear enough, in both cases (with and without postbuild.exe) same error.
Coordinator
Jan 13, 2016 at 10:17 AM
Did you also build MapWinGIS? If not you don't have the MapWinGISBin32 environment variable, which is used in postbuild.bat.
If you already have the MapWinGIS binaries (GDAL dlls, ocx) in your MW5 bin folder you can delete all lines in postbuild.bat except the last two:
cd %1
MW5.PostBuild.exe
Jan 13, 2016 at 2:12 PM
Edited Jan 18, 2016 at 11:48 AM
sorry again but I am confused, I will not going to work on MapWinGIS stuff
which all files goes into folder /bin/release/mapwingis?
for now I did this:
  • install mapwindow5 app and found there MapWinGis folder (with gdal dlls, ocx)
  • copied this folder to my /bin/release
  • postbuild.bat contain now only two lines:
    cd %1
    MW5.PostBuild.exe
  • after building PostBuild.bat allways exited with code 1
please, need for help
regards, Vojo
Jan 19, 2016 at 9:14 AM
Have same problem and also waiting to someone who can help with this problem.
(Win 8.1, 64bit PC, VS2013, FW4.5)

thanks, jdema
Coordinator
Jan 19, 2016 at 2:13 PM
How about you start with using the installer to install MW5 on your deployment machine.
When that is working you can rebuild MW5 on your development machine and manually copy the new binaries to the correct location.

Will that work for you?
Jan 25, 2016 at 9:49 AM
Edited Jan 25, 2016 at 9:51 AM
pmeems sorry, me again.

I tried to work as you proposed at last but no luck:
  • install original mw5 app
  • build my mw5 from git release
  • make one change in mw5/menu/menucomamnds.cs
  • copy mapwindow.exe from src/debug folder to mw5 app
  • run and program is not opened at all
Another combination and also no luck
  • install mapwingis_only files
  • copy mapwingis folder to my mapwindow5 build program
  • program starts running but quickly an error has occured:
An error has occured:
The type initializer for MW5.Api.Static.MapConfig threw an excep....
Retrieving the COM class factory for component with CLSID ...

at MW5.Api.Static.MapConfig.set_ZoomToFirstLayer(Boolean value)
at MW5.Helpers.MapInitializer.InitMapConfig() in c:\mapwindow5\src\MW5\Helpers\MapInitializer.cs:line 35
at MW5.Program.LoadConfig(IApplicationContainer container) in c:\mapwindow5\src\MW5\Program.cs:line 78
at MW5.Program.Main() in c:\mapwindow5\src\MW5\Program.cs:line 54

There are obviouslly many conflicts between different mapwingis.ocx version and other problems which I can not solve.

How to go on?
Coordinator
Jan 25, 2016 at 10:25 AM
If you get a 'Retrieving the COM class factory for component with CLSID' error it means it can't find the ocx.

But perhaps we're doing this the wrong way round.
What do you want to do? If you want to extent MW5 you can also build a plug-in. With a plug-in you have full access to the GUI of MW5 and you don't need to hack in the core code.

MW5 has an auto-update option which is enabled by default. Meaning if you don't disable it and we release a new installer it will be downloaded and installed over your version.
With a plug-in you don't have this problem.
Jan 25, 2016 at 11:36 AM
Edited Jan 26, 2016 at 6:59 AM
Yes. we will extend MW5 with our new plugins but also want to establish communication between our PowerBuilder (PB) application and MW5.
We like to show one GIS object from PB list in the middle of MW5 map.
And like to open PB data form when click on object (line, point, polygon, ....) in MW5 map.
To activate COM interoperability in .NET framework we must work with MW5 core code I think.
Also localization into our language will be problem too.

What do you suggest to go on?
Thanks and regards!
Coordinator
Jan 26, 2016 at 9:40 AM
I'm not familiar with PowerBuilder.

But if you can make the connection between PB and MW5 by altering the core code, you should be able to do the same using a plug-in.
What format does your GIS object have? Adding it to the middle of the map is possible by calling ZoomToLayer or ZoomToSelected. I'm not sure of the right names, so you need to check.

In MW5 you can catch the selectItem event (look at the identifier plug-in). Then your plug-in can do everything with the selected item, like opening a PB data form.
You can also consider making the data form in your plug-in and use a database connection to save the data.

How is your data currently stored?
You can also mail me with some more details about your application: bontepaarden[AT]gmailD0Tcom

Regards,

Paul
Jan 26, 2016 at 11:25 AM
Thanks Paul for your quick help. Only few questions are left:
  • How can I do localization without building the MW5?
  • Why building the MW5 is an option at all if we can do all stuff with new plugins?
  • Is really so hard to complete all MW5 stuff to build release folder for running on user computer?
We use shp, relational database sybase and spatialite database also and this all is now
included in dotspatial ver1.6 app which is tied with PB app.
But MW5 with MapWinGis is I think much more suitable for use in future.

Regards, Vojko
Feb 1, 2016 at 12:00 PM
Is there anybody who succesfully build MW5 and run app on deployment machine?
Really need help on this!
Thanks, Vojo
Coordinator
Feb 4, 2016 at 11:46 AM
Hi Vojo,

Do you also have problems with building MW5? If not you can use the INNOSetup to create an installer. The script is in the 'Install' folder in GIT.

Regarding translations. We haven't enabled this yet. Perhaps you can send your localization files as a pull request. I'll try them and include them in the core.
But then we also need an option to change the language. We had this in MW4. When I've got some free time (if ever :)) I'll try to add this.
Feb 4, 2016 at 6:28 PM
Edited Feb 5, 2016 at 10:37 AM
Hi Paul! thanks again, I am still stuck building MW5 for running the app on user computer. I will try to follow your latest instructions and use INNOSetup script; I have never used it before though.
Feb 29, 2016 at 2:44 PM
Hi Paul!

Today I did new clone and building of mapwindow5 was OK. On deployment computer it seems that works all except loading the TIF raster images >>>> "Mapwindow Core stopped working".
I think that MapWinGIS binaries (GDAL dlls, ocx) are missing or what?
Can you specify what is missing and where to put missing files, in which folder?

Regards, Vojo
Coordinator
Feb 29, 2016 at 3:01 PM
When you build as Release the PostBuild project will be build as well and it will run after compiling copying the necessary files from MapWinGIS.
Did you also compiled MapWinGIS if not you will not have these files.

If needed we can do a Hangout session later this week.
Feb 29, 2016 at 4:23 PM
I am not able to compile MapWinGis (have only VS Expres) so I will wait for your help with correct MapWinGis stuff for MW5.
Thanks, Vojo
Coordinator
Mar 2, 2016 at 9:14 AM
Can you mail me directly ar bontepaarden[AT]gmail[D0T]com so we can schedule a Hangout meeting?
Mar 14, 2016 at 10:41 AM
Compiling MapWindow 5 to run on deployment computer

Thanks Paul for helping me to successfully completed job. I am using win10 and VS community 2015.

Follow document Compile MW5 considering few modifications bellow.
Run the MapWinGIS installer as Admin it will be registered. If you are not sure you can run “regMapWinGis.cmd” as Admin again. You can install MapWinGIS in C:\mw\MapWinGIS.

Get the source code for MapWindow5. Clone the mapwindow5.codeplex.com GIT repository to C:\dev\mapwindow-v5. Check out the Master branch.
Set REM for both two lines in postbuild.bat.
Open the solution from C:\dev\mapwindow-v5\src\MW5.sln. Change the solution config to Release|x86.
Build the whole solution. This should work if you have registered mapwingis.ocx properly.
You should now get C:\dev\mapwindow-v5\bin\x86\Release.

Copy the MapWinGIS binaries from C:\mw\MapWinGIS to C:\dev\mapwindow-v5\bin\x86\Release\MapWinGIS.

Open the ISS file, which should be in C:\dev\mapwindow-v5\install.
It should start with these lines:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
; ##############################################
; MapWindow5 Inno Setup Script
; ##############################################
Make sure you have this version.

You can skip the including of the license files and you should have the SetupIconFile, redirect to the right place of the MW5.ico:

;Source: "D:\dev\MapwinGIS\GIT\support\GDAL_SDK\licenses*.rtf"; DestDir: "{app}\Licenses"; Flags: ignoreversion; Components: MapWindowS
;SetupIconFile=..\src\MW5\MW5.ico
Marked as answer by pmeems on 4/17/2016 at 3:27 AM