Kiosk Slide Show with a lil C# and PS

So, about a year ago, well, a year and six months ago, I was given a task. The task, was to replace our slideshow vendor that I guess we stopped paying or, whatever. Anyway I was given the opportunity to program and I took it!

My first problem I faced was how in the world do I get a slideshow to update on the fly? I did so with PowerShell. Below is my code:

New-Item -Force C:\Users\kuser\Slideshow -Type Directory

New-Item -Force C:\Users\kuser\Slideshow\logs -Type Directory

copy-item \\itnas\netshare\KioskSlideShow\Slideshow.ppsx C:\Users\kuser\Slideshow\Slideshow.ppsx -Recurse -Force

Start-Process C:\Users\kuser\Slideshow\Slideshow.ppsx

$A = 1

While ($A = 2)

{

$LastWritten = Get-Item \\itnas\netshare\KioskSlideShow\Slideshow.ppsx |Select-Object -ExpandProperty  LastWriteTime

start-sleep -Seconds 10

$CurrentWritten = Get-Item \\itnas\netshare\KioskSlideShow\Slideshow.ppsx |Select-Object -ExpandProperty  LastWriteTime

if ($CurrentWritten -ne $LastWritten)

{

$Process = Get-Process POWERPNT |select-object -ExpandProperty Id

Stop-Process $Process

copy-item \\itnas\netshare\KioskSlideShow\Slideshow.ppsx C:\Users\kuser\Slideshow\Slideshow.ppsx -Recurse -Force

Start-Process C:\Users\kuser\Slideshow\Slideshow.ppsx

}

else{

}
}

The above code is ran from the client machine, in startup, creates a directory called “slideshow” and copies the slideshow from a directory from a server and pastes it in that created directory. It then launches the PPSX, which launches in Full screen because you know, it’s a PPSX. Then it checks every ten seconds to see if the file time if different from the servers file. If it is different, it closes the PPSX, downloads the new PPSX and relaunches it.

This continues on forever and ever and ever.

BUT

WHAT IF YOU WANT THE PPSX TO UPDATE ITSELF!?

Enter in C#

I created the Kiosk Manager and Kiosk Client Powerpoint addins to help someone manage the PPSX more easily.

The Kiosk Manager addin allows a user to choose a time they would like a slide to “expire”, “un-expire” a slide, or hide or unhide a slide (“Toggle”). It does this by putting the date and time the user would want the slide to expire in the Notes field of each slide.

The Kiosk Client addin checks the next slide while still on the “current” slide to know whether or not to delete the slide. If the date and time match the current time or is prior to the date and time that is on that next slide the addin deletes that slide. That slide is no longer displayed, unless the user updates and saves the PPSX on the server.

So, yeah. That’s how that works. Questions? Let me know on github. Located here: https://github.com/goffr2/Kiosk-Slide-Show

I’ve included both precompiled exes and the complete Visual Studio files I used to create everything.

Leave a Comment