This commit is contained in:
Luc Vandenbroucke 2021-04-27 08:02:08 +02:00
parent 425bc4682c
commit f9f42ef35f
4 changed files with 104 additions and 102 deletions

View file

@ -21,7 +21,7 @@
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{3114A047-7562-42FE-94DE-2418EF19AD9A}</ProjectGuid>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<Keyword>ManagedCProj</Keyword>
<RootNamespace>EpdBase</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>

View file

@ -1,36 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
<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)?>
<?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" >
<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" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Feature Id="eDosStationFeature" Title="eDosStation" Level="1">
<ComponentGroupRef Id="eDosStation" />
</Feature>
<Feature Id="eDosSyncFeature" Title="eDosSync" Level="1">
<ComponentGroupRef Id="eDosSync" />
<ComponentGroupRef Id="SyncLog"/>
<ComponentRef Id="eDosSyncShortcut"/>
</Feature>
</Product>
<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;" />
</Fragment>
<Fragment>
<InstallExecuteSequence>
<Custom Action='CreateScheduledTask' After='InstallFiles'/>
</InstallExecuteSequence>
</Fragment>
<Fragment>
@ -50,28 +40,48 @@
<Fragment>
<SetDirectory Id="LogFolder" Value="[WindowsVolume]Logs" />
</Fragment>
<Fragment>
<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"/>
</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"/>
</Component>
</DirectoryRef>
<ComponentGroup Id="eDosStation" Directory="eDosStationFolder">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent"> -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
<ComponentRef Id="eDosStationShortcut"/>
<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" />
</Component>
<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="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="eDosStation.exe" Guid="bf9a54fc-5185-4e37-81eb-dfbf63d2586a">
<File Id="eDosStation.exe" Name="eDosStation.exe" Source="$(var.eDosStation_TargetDir)eDosStation.exe" />
</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>
@ -90,15 +100,7 @@
<Component Id="EpdBaseClr.dll" Guid="ed22005b-b3ba-4821-a598-d076ac94ea72">
<File Id="EpdBaseClr.dll" Name="EpdBaseClr.dll" Source="$(var.eDosStation_TargetDir)EpdBaseClr.dll" />
</Component>
<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"/>
</Component>
</ComponentGroup>
<ComponentGroup Id="eDosSync" Directory="eDosSyncFolder">
<Component Id="syncEdosLocal.exe.config" Guid="d1c4ba86-8a63-4b73-9179-a5eab405f8cb">
@ -116,15 +118,7 @@
<Component Id="eDosSync.xml" Guid="BC0FB8C2-26B1-47A5-A76F-C0ABE466770D">
<File Id="eDosSync.xml" Name="eDosSync.xml" Source="$(var.syncEdosLocal_TargetDir)eDosSync.xml" />
</Component>
<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"/>
</Component>
</ComponentGroup>
<ComponentGroup Id="SyncLog">
<Component Id="CreateLogFolder" Directory="LogFolder" Guid="EF959CF0-DC34-42A1-9031-2FE454DBED24">
@ -137,6 +131,18 @@
</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;" />
</Fragment>
<Fragment>
<InstallExecuteSequence>
<Custom Action='CreateScheduledTask' After='InstallFiles'/>
</InstallExecuteSequence>
</Fragment>
</Wix>

View file

@ -118,7 +118,6 @@ Global
{F98F3496-8A4C-4BDB-9F17-C7AF47A60739}.Debug|x64.ActiveCfg = Debug|x64
{F98F3496-8A4C-4BDB-9F17-C7AF47A60739}.Debug|x64.Build.0 = Debug|x64
{F98F3496-8A4C-4BDB-9F17-C7AF47A60739}.Debug|x86.ActiveCfg = Debug|Win32
{F98F3496-8A4C-4BDB-9F17-C7AF47A60739}.Debug|x86.Build.0 = Debug|Win32
{F98F3496-8A4C-4BDB-9F17-C7AF47A60739}.Release|Any CPU.ActiveCfg = Release|Win32
{F98F3496-8A4C-4BDB-9F17-C7AF47A60739}.Release|Any CPU.Build.0 = Release|Win32
{F98F3496-8A4C-4BDB-9F17-C7AF47A60739}.Release|ARM.ActiveCfg = Release|Win32
@ -126,7 +125,6 @@ Global
{F98F3496-8A4C-4BDB-9F17-C7AF47A60739}.Release|x64.ActiveCfg = Release|x64
{F98F3496-8A4C-4BDB-9F17-C7AF47A60739}.Release|x64.Build.0 = Release|x64
{F98F3496-8A4C-4BDB-9F17-C7AF47A60739}.Release|x86.ActiveCfg = Release|Win32
{F98F3496-8A4C-4BDB-9F17-C7AF47A60739}.Release|x86.Build.0 = Release|Win32
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Debug|ARM.ActiveCfg = Debug|Any CPU
@ -136,7 +134,6 @@ Global
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Debug|x64.ActiveCfg = Debug|Any CPU
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Debug|x64.Build.0 = Debug|Any CPU
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Debug|x86.ActiveCfg = Debug|Any CPU
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Debug|x86.Build.0 = Debug|Any CPU
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Release|Any CPU.Build.0 = Release|Any CPU
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Release|ARM.ActiveCfg = Release|Any CPU
@ -146,7 +143,6 @@ Global
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Release|x64.ActiveCfg = Release|Any CPU
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Release|x64.Build.0 = Release|Any CPU
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Release|x86.ActiveCfg = Release|Any CPU
{6AC69ACE-3666-4A3D-A4B9-FFA24C424C1B}.Release|x86.Build.0 = Release|Any CPU
{B2264FF1-0F36-401B-91FE-DB3087CE05F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2264FF1-0F36-401B-91FE-DB3087CE05F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2264FF1-0F36-401B-91FE-DB3087CE05F5}.Debug|ARM.ActiveCfg = Debug|Any CPU

View file

@ -305,19 +305,19 @@ namespace syncEdosLocal
System.Diagnostics.Debug.WriteLine(messages.ToString());
Console.WriteLine(messages.ToString());
var smtpFrom = System.Configuration.ConfigurationManager.AppSettings["smtpFrom"];
var smtpServer = System.Configuration.ConfigurationManager.AppSettings["smtpServer"];
int smtpPort = 25;
if (int.TryParse(System.Configuration.ConfigurationManager.AppSettings["smtpPort"], out int newSMTPPort)) smtpPort = newSMTPPort; ;
using (System.Net.Mail.MailMessage m = new System.Net.Mail.MailMessage())
{
m.From = new System.Net.Mail.MailAddress(smtpFrom);
m.To.Add("lvandenb@sckcen.be");
m.Subject = "SynceDosLocal " + (error ? "Error" : "No errors") + (warning ? " Warnings" : "");
m.IsBodyHtml = true;
m.Body = Bulker.htmlLog.ToString();
using (var mc = new System.Net.Mail.SmtpClient(smtpServer, smtpPort)) { mc.Send(m); }
}
//var smtpFrom = System.Configuration.ConfigurationManager.AppSettings["smtpFrom"];
//var smtpServer = System.Configuration.ConfigurationManager.AppSettings["smtpServer"];
//int smtpPort = 25;
//if (int.TryParse(System.Configuration.ConfigurationManager.AppSettings["smtpPort"], out int newSMTPPort)) smtpPort = newSMTPPort; ;
//using (System.Net.Mail.MailMessage m = new System.Net.Mail.MailMessage())
//{
// m.From = new System.Net.Mail.MailAddress(smtpFrom);
// m.To.Add("lvandenb@sckcen.be");
// m.Subject = "SynceDosLocal " + (error ? "Error" : "No errors") + (warning ? " Warnings" : "");
// m.IsBodyHtml = true;
// m.Body = Bulker.htmlLog.ToString();
// using (var mc = new System.Net.Mail.SmtpClient(smtpServer, smtpPort)) { mc.Send(m); }
//}
spLog.CloseSplunkLog();
}
static void DoorloopVisits(SqlConnection coLocal, SqlConnection coCentral, spl spLog, ref bool error)