Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt
hiddentrue

Approved by: Sean Holden on  

Confluence/External link(s) used:

Description

The provided Filesets are examples of notifying users, in particular here, a message regarding Fileset status when downloading and installing new Filesets.

...

Each service has been built to be actioned automatically by the user logging in.  Where Filesets are disassociated, each has a pre-uninstallation script to ensure the services should also be removed.

Ingredients


  • Provided Fileset
↓ Windows↓ macOS


Directions

For the example provided:

...

UI Tabs


UI Tab
titleWindows

Windows

Locate the "BallonTipSwitchWatcher.ps1" file within the Fileset and choose to edit.  In the following code block snippet from this script, the switch statement is pattern matching text.  In the provided example the script is looking for lines that contain any one of the following:

  • Model version
  • Downloading Fileset
  • Done activating
  • Activate all

Where found, the 'ShowBalloonTipInfo' function is being used to prompt the user:

Code Block
languagepowershell
titleBallonTipSwitchWatcher.ps1
$changeAction = Get-Content C:\ProgramData\FileWave\FWClient\fwcld.log -tail 1 -wait | ForEach-Object {
switch($_) {
{ $_ -match "Model version" -or $_ -match "Downloading Fileset" -or $_ -match "Done activating" -or $_ -match "Activate all" } { ShowBalloonTipInfo ("FileWave: ",$_.split("|")[4]) }

The second part of the switch statement is causing the script to exit.  The pattern match this time, is any line that contains:

  • Installation
Code Block
languagepowershell
titleBallonTipSwitchWatcher.ps1
{ $_ -match "Installation" } { break }



UI Tab
titlemacOS

macOS

Locate the "prompt_user.sh" file within the Fileset and choose to edit.  In the following code block snippet from this script, the case statement is pattern matching text.  In the provided example the script is looking for lines that contain any one of the following:

  • Model version
  • Downloading Fileset
  • Done activating
  • Activate all

Where found, the 'show_message' function is being used to prompt the user:

Code Block
languagepowershell
titleprompt_user.sh
# * are wildcard entries and | acts as a logical OR
case "$line" in
		*"Model version"*|*"Downloading Fileset"*|*"Done activating"*|*"Activate all"*)
			show_message
			;;

The second part of the case statement is causing the script to exit.  The pattern match this time, is any line that contains:

  • Data successfully sent to the inventory server
Code Block
languagepowershell
titleprompt_user.sh
*"Data successfully sent to the inventory server"*)
			exit 0
			;;

Notification Center Permissions

Notifications are user choice.  Users must accept notifications when prompted.

The below section of the 'com.filewave.promptuser.plist' may be edit as desired, where the defined keys determine the following:

  • 'the_title' is the Title of the notification
  • 'bundle_id' defines an App bundle.  That bundles name and icon will be displayed:


Code Block
languagepowershell
titlecom.filewave.prompt_user.plist
	<key>EnvironmentVariables</key>
	<dict>
		<key>the_title</key>
		<string>FileWave Message</string>
		<key>the_subtitle</key>
		<string></string>
		<key>bundle_id</key>
		<string>com.filewave.fwGUI</string>
	</dict>


Users may still allow Notifications in System Preferences if previously denied:

Info
titleLaunch Services

Once a launch service is running, editing an already loaded script will have no impact on the current service; the service itself must be reloaded.  If parts of the Fileset are edited after association, consideration of this should be taken into account to ensure those changes are made active.



Notes

The above provides an example of notifying users, using a service.  However, with some adaptation messages could be sent in other ways at alternate times to users.

...