Skip to content

Commit 69348d6

Browse files
committed
msi: recommend Fluentd enterprise service
In the previous versions, there were no navigation to access Fluentd enterprise services. It might be useful to provide such navigation link for Fluentd users. Signed-off-by: Kentaro Hayashi <[email protected]>
1 parent d74608e commit 69348d6

File tree

5 files changed

+50
-0
lines changed

5 files changed

+50
-0
lines changed

fluent-package/Rakefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,13 @@ class BuildTask
575575
desc "Install additional .bat files for Windows"
576576
task :win_batch_files do
577577
ensure_directory(staging_bindir)
578+
ensure_directory(staging_sharedir)
578579
cp("msi/assets/#{PACKAGE_NAME}-prompt.bat", fluent_package_staging_dir)
579580
cp("msi/assets/#{PACKAGE_NAME}-post-install.bat", staging_bindir)
580581
cp("msi/assets/#{PACKAGE_NAME}-post-migration.bat", staging_bindir)
582+
cp("msi/assets/#{PACKAGE_NAME}-post-toast.bat", staging_bindir)
583+
cp("msi/assets/#{PACKAGE_NAME}-post-toast.ps1", staging_bindir)
584+
cp("msi/assets/#{PACKAGE_NAME}-toast-icon.png", staging_sharedir)
581585
cp("msi/assets/#{SERVICE_NAME}.bat", fluent_package_staging_dir)
582586
cp("msi/assets/fluent-gem.bat", fluent_package_staging_dir)
583587
cp("msi/assets/#{PACKAGE_NAME}-version.rb", staging_bindir)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@echo off
2+
title Fluent-package post toast script
3+
if exist "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" (
4+
if exist "%~dp0..\bin\fluent-package-post-toast.ps1" (
5+
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "%~dp0..\bin\fluent-package-post-toast.ps1"
6+
)
7+
)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
$binDir = $(Split-Path $MyInvocation.MyCommand.Path -Parent)
2+
$topDir = $(Split-Path $binDir -Parent)
3+
$xml = @"
4+
<toast scenario="reminder">
5+
<visual>
6+
<binding template="ToastGeneric">
7+
<image id="1" placement="appLogoOverride" src="$(Join-Path $topDir -ChildPath "share/fluent-package-toast-icon.png")" alt="Fluentd logo"/>
8+
<text>Fluent Package has been installed!</text>
9+
<text>If you want enterprise technical support, access the following URL</text>
10+
<text>https://www.fluentd.org/enterprise=services</text>
11+
</binding>
12+
</visual>
13+
<actions>
14+
<action content="Check enterprise services for Fluentd" activationType="protocol" arguments="https://www.fluentd.org/enterprise_services" />
15+
</actions>
16+
</toast>
17+
"@
18+
$XmlDocument = [Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime]::New()
19+
$XmlDocument.loadXml($xml)
20+
# Fluent Package Command Prompt
21+
#$App = $(Get-StartApps -Name "Fluent Package Command Prompt")
22+
#$AppId = $App.AppID
23+
$AppId = '{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\powershell.exe'
24+
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]::CreateToastNotifier($AppId).Show($XmlDocument)
9.84 KB
Loading

fluent-package/msi/source.wxs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,17 @@
280280
Return="check"
281281
Impersonate="no" />
282282

283+
<Property Id="PostNotifyWithToastBat" Value=" "/>
284+
<CustomAction Id="SetPostNotifyWithToastBat"
285+
Property="PostNotifyWithToastBat"
286+
Value="&quot;[FLUENTPROJECTLOCATION]bin\fluent-package-post-toast.bat&quot;"/>
287+
<CustomAction Id="PostNotifyWithToastBat"
288+
BinaryKey="WixCA"
289+
DllEntry="WixQuietExec64"
290+
Execute="deferred"
291+
Return="check"
292+
Impersonate="no" />
293+
283294
<InstallExecuteSequence>
284295
<Custom Action="SetPostInstallCommand" After="InstallFiles">NOT Installed</Custom>
285296
<Custom Action="PostInstall" After="SetPostInstallCommand">NOT Installed</Custom>
@@ -295,6 +306,10 @@
295306
<Custom Action="SetCreateCompatTdAgentGemBat" Before="InstallFinalize">NOT Installed</Custom>
296307
<Custom Action="CreateCompatTdAgentGemBat" After="SetCreateCompatTdAgentGemBat">NOT Installed</Custom>
297308

309+
<!-- Notify enterprise services for Fluentd users -->
310+
<Custom Action="SetPostNotifyWithToastBat" Before="InstallFinalize">NOT Installed</Custom>
311+
<Custom Action="PostNotifyWithToastBat" After="SetPostNotifyWithToastBat">NOT Installed</Custom>
312+
298313
<!-- Delete hardlink before removing installed files -->
299314
<Custom Action="SetDeleteCompatTdAgentBat" After="InstallInitialize">Installed AND NOT REINSTALL</Custom>
300315
<Custom Action="DeleteCompatTdAgentBat" After="SetDeleteCompatTdAgentBat">Installed AND NOT REINSTALL</Custom>

0 commit comments

Comments
 (0)