Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions fluent-package/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,13 @@ class BuildTask
desc "Install additional .bat files for Windows"
task :win_batch_files do
ensure_directory(staging_bindir)
ensure_directory(staging_sharedir)
cp("msi/assets/#{PACKAGE_NAME}-prompt.bat", fluent_package_staging_dir)
cp("msi/assets/#{PACKAGE_NAME}-post-install.bat", staging_bindir)
cp("msi/assets/#{PACKAGE_NAME}-post-migration.bat", staging_bindir)
cp("msi/assets/#{PACKAGE_NAME}-post-toast.bat", staging_bindir)
cp("msi/assets/#{PACKAGE_NAME}-post-toast.ps1", staging_bindir)
cp("msi/assets/#{PACKAGE_NAME}-toast-icon.png", staging_sharedir)
cp("msi/assets/#{SERVICE_NAME}.bat", fluent_package_staging_dir)
cp("msi/assets/fluent-gem.bat", fluent_package_staging_dir)
cp("msi/assets/#{PACKAGE_NAME}-version.rb", staging_bindir)
Expand Down
7 changes: 7 additions & 0 deletions fluent-package/msi/assets/fluent-package-post-toast.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo off
title Fluent-package post toast script
if exist "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" (
if exist "%~dp0..\bin\fluent-package-post-toast.ps1" (
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "%~dp0..\bin\fluent-package-post-toast.ps1"
)
)
23 changes: 23 additions & 0 deletions fluent-package/msi/assets/fluent-package-post-toast.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$binDir = $(Split-Path $MyInvocation.MyCommand.Path -Parent)
$topDir = $(Split-Path $binDir -Parent)
$xml = @"
<toast scenario="reminder">
<visual>
<binding template="ToastGeneric">
<image id="1" placement="appLogoOverride" src="$(Join-Path $topDir -ChildPath "share/fluent-package-toast-icon.png")" alt="Fluentd logo"/>
<text>Fluent Package has been installed!</text>
<text>If you want enterprise technical support, access the following URL</text>
<text>https://www.fluentd.org/enterprise=services</text>
</binding>
</visual>
<actions>
<action content="Check enterprise services for Fluentd" activationType="protocol" arguments="https://www.fluentd.org/enterprise_services" />
</actions>
</toast>
"@
$XmlDocument = [Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime]::New()
$XmlDocument.loadXml($xml)
# Fluent Package Command Prompt
$App = $(Get-StartApps -Name "Fluent Package Command Prompt")
$AppId = $App.AppID
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]::CreateToastNotifier($AppId).Show($XmlDocument)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions fluent-package/msi/source.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,17 @@
Return="check"
Impersonate="no" />

<Property Id="PostNotifyWithToastBat" Value=" "/>
<CustomAction Id="SetPostNotifyWithToastBat"
Property="PostNotifyWithToastBat"
Value="&quot;[FLUENTPROJECTLOCATION]bin\fluent-package-post-toast.bat&quot;"/>
<CustomAction Id="PostNotifyWithToastBat"
BinaryKey="WixCA"
DllEntry="WixQuietExec64"
Execute="deferred"
Return="check"
Impersonate="yes" />

<InstallExecuteSequence>
<Custom Action="SetPostInstallCommand" After="InstallFiles">NOT Installed</Custom>
<Custom Action="PostInstall" After="SetPostInstallCommand">NOT Installed</Custom>
Expand All @@ -295,6 +306,10 @@
<Custom Action="SetCreateCompatTdAgentGemBat" Before="InstallFinalize">NOT Installed</Custom>
<Custom Action="CreateCompatTdAgentGemBat" After="SetCreateCompatTdAgentGemBat">NOT Installed</Custom>

<!-- Notify enterprise services for Fluentd users -->
<Custom Action="SetPostNotifyWithToastBat" Before="InstallFinalize">NOT Installed</Custom>
<Custom Action="PostNotifyWithToastBat" After="SetPostNotifyWithToastBat">NOT Installed</Custom>

<!-- Delete hardlink before removing installed files -->
<Custom Action="SetDeleteCompatTdAgentBat" After="InstallInitialize">Installed AND NOT REINSTALL</Custom>
<Custom Action="DeleteCompatTdAgentBat" After="SetDeleteCompatTdAgentBat">Installed AND NOT REINSTALL</Custom>
Expand Down
Loading