Hexagon Geospatial
MENU

WebGIS

Need a push in the right direction when configuring WebMap, Portal or SDI services? Looking for hints and tips, or just looking for Ideas and information? The WebGIS discussion board is where you start those discussions, connect and share information.
Showing results for 
Search instead for 
Do you mean 
Reply
Regular Contributor
Posts: 300
Registered: ‎10-12-2015
Accepted Solution

Publish to SmartStore via batch (v2018)

For those using batch files or similar to publish to GeoMedia SmartStores, in version 2018 looks like need to add an additional entry to the batch file:

set path=C:\Program Files (x86)\Common Files\Intergraph\GeoMedia\Program\PrivateAssemblies;%path%

 

If the path entry is not added, will likely find something like following in the smartstore log file:

Started at 28/05/2018 9:28:12 AM

Could not establish the specified warehouse connection.

Published 0 of 0 selected feature classes
Completed at 28/05/2018 9:28:13 AM

 

I'm not sure if its a good idea to add C:\Program Files (x86)\Common Files\Intergraph\GeoMedia\Program\PrivateAssemblies to the system path or not as an alternative to adding to the batch file.

I also notice with v2018 the webmap entry for PrivateAssemblies is aliased (linked) to the GeoMedia PrivateAssemblies, so looks like it does not matter if you set path to GeoMedia or WebMap PrivateAssemblies. Don't know if that will be the case going forward.

Regular Contributor
Posts: 229
Registered: ‎10-26-2015

Re: Publish to SmartStore via batch (v2018)

Shaun,

Have you logged this as a support ticket to confirm this is a change in the product? If so, there should be something in the SmartStore Publish Utility documentation.

Thanks,

Colin

hbm
Staff
Posts: 292
Registered: ‎11-05-2015

Re: Publish to SmartStore via batch (v2018)

This change was brought on by having some of the common components switch to a private deployment scheme. Hence the "PrivateAssemblies" name of the directory containing the common binaries.

 

Apart from changing the global PATH environment variable (a big no, no), or adding it as one of the batch file's preparatory steps (much better), one could try to change the SmartProf.exe invocation to the following:

START "" /WAIT SmartProf.exe <original parameters>

This way, one should leverage the already existing system configuration which makes the Publish To SmartStore utility work from the Windows Explorer. That's because the PATH variable has already been extended using the Application Registration mechanism in Windows (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\SmartProf.exe). Unfortunately running from the command line or a batch file makes use of the CreateProcess call (ignores the registry), while running from Explorer or using START does ShellExecuteEx (honors the registry).

 

Kudos to Shaun for catching this and sharing his workaround!

Regular Contributor
Posts: 300
Registered: ‎10-12-2015

Re: Publish to SmartStore via batch (v2018)

[ Edited ]

I like the idea of using the START as no paths need to be specified - which  reduces potential upgrade issues when paths can change etc and less environment dependent.

 

One trap I did find - if you already have C:\Program Files (x86)\Common Files\Intergraph\GeoMedia\Program in your system path, then it won't work. (not sure how it got added to my path - but its there). Looking at some articles, Start checks path before apppaths, so I'm guessing start found SmartPub.exe in the path and didn't add apppaths to the system.

 

With C:\Program Files (x86)\Common Files\Intergraph\GeoMedia\Program in system path

SET PATH=C:\ProgramData\Oracle\Java\javapath;C:\app\client\Administrator\product\12.2.0\client_1;C:\app\client\Administrator\product\12.2.0\client_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Intergraph\GeoMedia\Program;C:\Program Files (x86)\Common Files\Intergraph\CoordSystems\Program;C:\Program Files (x86)\Common Files\Intergraph;C:\Program Files (x86)\Hexagon\GeoMedia WebMap\Program;C:\Users\srfalcon\AppData\Local\Microsoft\WindowsApps;

 

start "" /w SmartPub.exe -p C:\Warehouses\SmartStore\defs\GeoTrainSpatial2193.ssp -l C:\Warehouses\SmartStore\defs\GeoTrainSpatial2193.log
Results in 'Could not establish the specified warehouse connection.'

 

Without C:\Program Files (x86)\Common Files\Intergraph\GeoMedia\Program in system path:

SET PATH=C:\ProgramData\Oracle\Java\javapath;C:\app\client\Administrator\product\12.2.0\client_1;C:\app\client\Administrator\product\12.2.0\client_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Intergraph\CoordSystems\Program;C:\Program Files (x86)\Common Files\Intergraph;C:\Program Files (x86)\Hexagon\GeoMedia WebMap\Program;C:\Users\srfalcon\AppData\Local\Microsoft\WindowsApps;

 

start "" /w SmartPub.exe -p C:\Warehouses\SmartStore\defs\GeoTrainSpatial2193.ssp -l C:\Warehouses\SmartStore\defs\GeoTrainSpatial2193.log
Results in successful smartstore publish.

 

 

Currently I'm updating my batch file to (snippet):

pushd %SmartStoreDefsDir%
set origPath=%path%
REM Warning - If specific smartpub warehouse connection underlying drivers needs additional content in path then could fail? (e.g. Oracle that has entries in path??)
set path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\wbem;
for %%I in (*.ssp) do (
  START "" /WAIT SmartPub.exe -p %%~nxI -l %%~nI.log
)
set path=%origPath%

popd

 

Works for my SQL Server spatial based warehouse, have not tested for Oracle or similar warehouse - I don't have Oracle available. I suspect it won't be an issue, just not so familiar with it these days.

Highlighted
Regular Contributor
Posts: 229
Registered: ‎10-26-2015

Re: Publish to SmartStore via batch (v2018)

So I've run some tests this morning and and confirmed the suggestions by ShaunF and hbm are both valid.

 

I looked back to an issue with SmartPub.exe that was introduced with the 2013 (13.0) release which introduced the use of the START command. There was a lot of confusion with this change when it was made as it didn't get documented until the 2015 (15.0) release and a lot of our customers kept reporting the issue of batch publishing of SmartStores failing.

 

Looking at my notes I took on what customers needed to do to make batch publishing work I've discovered there is no change introduced in the 2018 release that stops batch publishing. 

 

My notes previously stated that there should not be a GeoMedia Program folder path in the system path to make the process run correctly.

 

It does appear installing new versions of the software is adding the GeoMedia Program folder to the system path. As soon as I remove it I can use the 2018 version of SmartPub.exe fine in the same way I've done for previous versions:

 

Start /WAIT SmartPub.exe -p C:\Warehouses\DDC_OUT\WORLD.SSP -l C:\Warehouses\DDC_OUT\WORLD.LOG

Is it safe to permanently remove the GeoMedia Program folder from the system path?

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.