extra error checking

This commit is contained in:
Luc Vandenbroucke 2021-04-27 10:41:04 +02:00
parent f9f42ef35f
commit df90ac8073
7 changed files with 56 additions and 80 deletions

View file

@ -1,28 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?define eDosStation_TargetDir=$(var.eDosStation.TargetDir)?>
<?define eDosSync_TargetDir=$(var.syncEdosLocal.TargetDir)?>
<?define syncEdosLocal_TargetDir=$(var.syncEdosLocal.TargetDir)?>
<Product Id="*" Name="eDosStation" Language="1033" Version="1.0.1.0" Manufacturer="SCK CEN Luc" UpgradeCode="24e037ca-edbb-49d5-85d4-3a93dd7d10d8" >
<Product Id="*" Name="eDosStation" Language="1033" Version="1.0.2.0" Manufacturer="SCK CEN Luc" UpgradeCode="24e037ca-edbb-49d5-85d4-3a93dd7d10d8">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Comments="EPD lees software en synchronisatie tussen local en remote database" InstallPrivileges="elevated" Platform="x86" />
<Media Id="1" EmbedCab="yes" Cabinet="cab" />
<Media Id="1" EmbedCab="yes" Cabinet="cab" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Feature Id="eDosStationFeature" Title="eDosStation" Level="1">
<ComponentGroupRef Id="eDosStation" />
<ComponentRef Id="eDosStationShortcut" />
</Feature>
<Feature Id="eDosSyncFeature" Title="eDosSync" Level="1">
<ComponentGroupRef Id="eDosSync" />
<ComponentGroupRef Id="SyncLog"/>
<ComponentRef Id="eDosSyncShortcut"/>
<ComponentGroupRef Id="SyncLog" />
<ComponentRef Id="eDosSyncShortcut" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
@ -32,7 +28,7 @@
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="eDos"/>
<Directory Id="ApplicationProgramsFolder" Name="eDos" />
</Directory>
<Directory Id="LogFolder" />
</Directory>
@ -46,42 +42,35 @@
<DirectoryRef Id="eDosStationFolder">
<Component Id="eDosStationShortcut" Guid="85AF80D8-11AC-4B82-89F8-5764A41EF3CE">
<Shortcut Id="eDosStationMenuShortcut"
Name="eDos Station"
Description="eDos Epd issuing"
Target="[#eDosStation.exe]"
WorkingDirectory="eDosStationFolder"/>
<RemoveFolder Id="CleanUpeDosStationShortcut" Directory="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKLM" Key="Software\SCKCEN\eDosStation" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
<Shortcut Id="eDosStationMenuShortcut" Name="eDos Station" Description="eDos Epd issuing" Target="[#eDosStation.exe]" WorkingDirectory="eDosStationFolder" />
<RemoveFolder Id="CleanUpeDosStationShortcut" Directory="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKLM" Key="Software\SCKCEN\eDosStation" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="eDosSyncFolder">
<Component Id="eDosSyncShortcut" Guid="ED01D079-54BA-4D1E-ACCF-6A79565C9D32">
<Shortcut Id="eDosSyncMenuShortcut"
Name="eDos sync"
Description="eDos sync to/from local"
Target="[#syncEdosLocal.exe]"
WorkingDirectory="eDosSyncFolder"/>
<RemoveFolder Id="CleanUpeDosSyncShortCut" Directory="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKLM" Key="Software\SCKCEN\eDosSync" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
<Shortcut Id="eDosSyncMenuShortcut" Name="eDos sync" Description="eDos sync to/from local" Target="[#syncEdosLocal.exe]" WorkingDirectory="eDosSyncFolder" />
<RemoveFolder Id="CleanUpeDosSyncShortCut" Directory="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKLM" Key="Software\SCKCEN\eDosSync" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<ComponentGroup Id="eDosStation" Directory="eDosStationFolder">
<ComponentRef Id="eDosStationShortcut"/>
<Component Id="eDosStation.exe" Guid="bf9a54fc-5185-4e37-81eb-dfbf63d2586a">
<Component Id="eDosStation.exe" Guid="bf9a54fc-5185-4e37-81eb-dfbf63d2586a">
<File Id="eDosStation.exe" Name="eDosStation.exe" Source="$(var.eDosStation_TargetDir)eDosStation.exe" />
</Component>
<Component Id="eDosStation.exe.config" Guid="f052d72c-32dd-4108-80b4-35773564b2cc">
<File Id="eDosStation.exe.config" Name="eDosStation.exe.config" Source="$(var.eDosStation_TargetDir)eDosStation.exe.config" />
</Component>
<Component Id="IR_READER_MS_DLL.dll" Guid="7dc99dd1-1611-4397-84ba-ae56ed455f68">
<File Id="IR_READER_MS_DLL.dll" Name="IR_READER_MS_DLL.dll" Source="$(var.eDosStation_TargetDir)IR_READER_MS_DLL.dll" ProcessorArchitecture="x86" Vital="yes" />
<File Id="IR_READER_MS_DLL.dll" Name="IR_READER_MS_DLL.dll" Source="$(var.eDosStation_TargetDir)IR_READER_MS_DLL.dll" />
</Component>
<Component Id="Reader2.dll" Guid="64258699-5bc6-49bf-a01c-2297206a37d4" >
<Component Id="Reader2.dll" Guid="64258699-5bc6-49bf-a01c-2297206a37d4">
<File Id="Reader2.dll" Name="Reader2.dll" Source="$(var.eDosStation_TargetDir)Reader2.dll" />
</Component>
<Component Id="Telerik.Windows.Data.dll" Guid="8d506a90-f3ff-40ac-8c5c-fc89af3fc9f3">
<File Id="Telerik.Windows.Data.dll" Name="Telerik.Windows.Data.dll" Source="$(var.eDosStation_TargetDir)Telerik.Windows.Data.dll" />
</Component>
@ -94,14 +83,17 @@
<Component Id="Telerik.Windows.Controls.Input.dll" Guid="a1ee1a08-793e-4b55-a122-b3f1726f4f78">
<File Id="Telerik.Windows.Controls.Input.dll" Name="Telerik.Windows.Controls.Input.dll" Source="$(var.eDosStation_TargetDir)Telerik.Windows.Controls.Input.dll" />
</Component>
<Component Id="LSWDesfirePublic.dll" Guid="aac035cc-de9b-4dc6-92ae-7f0e173928c6">
<File Id="LSWDesfirePublic.dll" Name="LSWDesfirePublic.dll" Source="$(var.eDosStation_TargetDir)LSWDesfirePublic.dll" />
</Component>
<Component Id="EpdBaseClr.dll" Guid="ed22005b-b3ba-4821-a598-d076ac94ea72">
<File Id="EpdBaseClr.dll" Name="EpdBaseClr.dll" Source="$(var.eDosStation_TargetDir)EpdBaseClr.dll" />
</Component>
</ComponentGroup>
<ComponentGroup Id="eDosSync" Directory="eDosSyncFolder">
<Component Id="syncEdosLocal.exe.config" Guid="d1c4ba86-8a63-4b73-9179-a5eab405f8cb">
<File Id="syncEdosLocal.exe.config" Name="syncEdosLocal.exe.config" Source="$(var.syncEdosLocal_TargetDir)syncEdosLocal.exe.config" />
@ -115,11 +107,11 @@
<Component Id="LSWLib.dll" Guid="27679139-5900-4901-b148-751e49c9bc74">
<File Id="LSWLib.dll" Name="LSWLib.dll" Source="$(var.syncEdosLocal_TargetDir)LSWLib.dll" />
</Component>
<Component Id="eDosSync.xml" Guid="BC0FB8C2-26B1-47A5-A76F-C0ABE466770D">
<File Id="eDosSync.xml" Name="eDosSync.xml" Source="$(var.syncEdosLocal_TargetDir)eDosSync.xml" />
<Component Id="edossync.xml" Guid="b141fa44-2c0c-4836-8e5d-1798db6e3540">
<File Id="edossync.xml" Name="edossync.xml" Source="$(var.syncEdosLocal_TargetDir)edossync.xml" />
</Component>
</ComponentGroup>
<ComponentGroup Id="SyncLog">
<Component Id="CreateLogFolder" Directory="LogFolder" Guid="EF959CF0-DC34-42A1-9031-2FE454DBED24">
<CreateFolder>
@ -132,17 +124,15 @@
</Fragment>
<Fragment>
<CustomAction Id="CreateScheduledTask" Return="check" Directory="eDosSyncFolder"
Execute="deferred"
Impersonate="no"
ExeCommand="SCHTASKS.EXE /CREATE /TN &quot;EDos Sync&quot; /RP &quot;Infopla+8&quot; /XML &quot;[eDosSyncFolder]\edossync.xml&quot;" />
<CustomAction Id="CreateScheduledTask" Return="check" Directory="eDosSyncFolder" Execute="deferred" Impersonate="no" ExeCommand="SCHTASKS.EXE /CREATE /TN &quot;EDos Sync&quot; /RU &quot;eDosStation&quot;/RP &quot;Infopla+8&quot; /XML &quot;[eDosSyncFolder]\edossync.xml&quot;" />
</Fragment>
<Fragment>
<InstallExecuteSequence>
<Custom Action='CreateScheduledTask' After='InstallFiles'/>
<Custom Action="CreateScheduledTask" After="InstallFiles" />
</InstallExecuteSequence>
</Fragment>
</Wix>

View file

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-16"?>
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DeployedProjects>
<string>syncEdosLocal\syncEdosLocal.csproj</string>
<string>eDosStation\eDosStation.csproj</string>
<string>syncEdosLocal\syncEdosLocal.csproj</string>
</DeployedProjects>
<DirectoryMappings>
<Item Key="" Value="INSTALLFOLDER" />
</DirectoryMappings>
<FileMappings />
<DeploySymbols>false</DeploySymbols>
<DeployLocalizations>false</DeployLocalizations>
<DeploySymbols>true</DeploySymbols>
<DeployLocalizations>true</DeployLocalizations>
<DeployExternalLocalizations>false</DeployExternalLocalizations>
<ExcludedProjectItems>-</ExcludedProjectItems>
</Configuration>

View file

@ -22,6 +22,15 @@
<ItemGroup>
<Compile Include="Product.wxs" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
</ItemGroup>
<ItemGroup>
<Content Include="eDosSetup.wax" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\eDosStation\eDosStation.csproj">
<Name>eDosStation</Name>
@ -40,15 +49,6 @@
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="SetupProject1.wax" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
</ItemGroup>
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">

View file

@ -9,6 +9,5 @@
<ResourceDictionary Source="eDosDict.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

View file

@ -101,15 +101,20 @@ namespace eDosStation
private void init()
{
first();
currentConStr = System.Configuration.ConfigurationManager.ConnectionStrings["eDosStation.Properties.Settings.localConnectionString"].ConnectionString;
ConCentralStr = System.Configuration.ConfigurationManager.ConnectionStrings["eDosConnectionString"].ConnectionString;
localConnection = new SqlConnection(currentConStr);
NextIDCommand = new SqlCommand("SELECT NEXT VALUE FOR VisitSequence as VisitID", localConnection);
isLocal = true;
MakeCommands();
bool rv= checkCon(false);
try
{
first();
currentConStr = System.Configuration.ConfigurationManager.ConnectionStrings["eDosStation.Properties.Settings.localConnectionString"].ConnectionString;
ConCentralStr = System.Configuration.ConfigurationManager.ConnectionStrings["eDosConnectionString"].ConnectionString;
localConnection = new SqlConnection(currentConStr);
NextIDCommand = new SqlCommand("SELECT NEXT VALUE FOR VisitSequence as VisitID", localConnection);
isLocal = true;
MakeCommands();
bool rv = checkCon(false);
} catch (Exception ex)
{
System.Windows.MessageBox.Show($"Init error {ex.Message} con={currentConStr}");
}
}
public DataInterface()

View file

@ -60,7 +60,7 @@ namespace eDosStation
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
Settings s = new Settings( thisStation);
Settings s = new Settings(thisStation);
s.ShowDialog();
}
@ -93,9 +93,9 @@ namespace eDosStation
bool ok = true;
string errMsg = string.Empty;
dataInterface = new DataInterface();
try
{
dataInterface = new DataInterface();
thisStation = new Station(dataInterface, string.Empty);
}
catch (System.Exception ex)

View file

@ -89,24 +89,6 @@
<ManifestTimestampUrl>http://timestamp.digicert.com</ManifestTimestampUrl>
</PropertyGroup>
<ItemGroup>
<Reference Include="SharpDX, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\packages\SharpDX.4.2.0\lib\net45\SharpDX.dll</HintPath>
</Reference>
<Reference Include="SharpDX.D3DCompiler, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\packages\SharpDX.D3DCompiler.4.2.0\lib\net45\SharpDX.D3DCompiler.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Direct2D1, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\packages\SharpDX.Direct2D1.4.2.0\lib\net45\SharpDX.Direct2D1.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Direct3D10, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\packages\SharpDX.Direct3D10.4.2.0\lib\net45\SharpDX.Direct3D10.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Direct3D9, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\packages\SharpDX.Direct3D9.4.2.0\lib\net45\SharpDX.Direct3D9.dll</HintPath>
</Reference>
<Reference Include="SharpDX.DXGI, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\packages\SharpDX.DXGI.4.2.0\lib\net45\SharpDX.DXGI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />