Expiration Date v2.4 for BartPE
by John Tait (john925)
December 5, 2004What does Expiration Date do?
Expiration Date lets you set a Start Date and End Date for a BartPE CD. If someone tries to boot a system outside of the Start Date - End Date range the boot will be prevented in one of several ways described below. Obviously the system date can be changed in the BIOS to make the CD boot so this is not fool-proof protection. It works best as protection in "Hang the system." mode or in combination with a plugin like Viceroy's Secure Screen.
Install Expiration Date.
- Download the Expiration Date plugin from userwww.sfsu.edu/~john/PEBuilder. Run the self-extracting executable then copy the _ExpirationDate240 folder to your PEBuilder plugin folder.
- Optional
- Download Paraglider's Shutdown Plugin. Expand it then copy shutdown.exe from its files folder to the Expiration Date plugin's files folder.
- Optional
- Download and install Viceroy's Secure Screen Plugin. See below for more information.
- Run SetExpirationDate.exe to set the Start Date, End Date, and possibly the Mode, before running PEBuilder.
- The Start Date defines the earliest date your BartPE CD will successfully boot. The Start Date is initially set to January 1, 2000.
- The End Date defines the last date your BartPE CD will successfully boot. The End Date is initially set to January 1, 2020.
- The mode defines what action is taken if the CD is out-of-date. There are three modes:
- Hang the system.
- Shutdown w/ notification. (requires shutdown.exe)
- Shutdown immediately. (requires shutdown.exe)
The mode is initially set to "Hang the system."
Setup Expiration Date using the GUI interface.
- Run SetExpirationDate.exe from the plugin's files folder. The startup window displays the current Start Date, End Date, and Mode.
- Set the Start Date and End Date
- Select a new Start Date, End Date, or both using the drop-down calendars.
- When you select a date from a calendar the date control displays the new date. You are told it is a "Proposed New" date. The "Save New Settings" and "Display Last Saved Settings" buttons become active.
- Set the Mode
- The mode defines the action taken when a disk is out-of-date. Set the mode by clicking on one of the three radio buttons. The choices are:
- Hang the system.
BartPE looks like it has successfully booted but no applications will run. You will see memory related error messages. This mode is designed to make the OS on the CD appear corrupt.- Shutdown w/ notification.
A message box pops up stating that the CD has expired. Closing the message box or waiting thirty seconds shuts the system down. The CD will be ejected as part of the shutdown process.- Shutdown immediately.
The system shuts down with no warning. The CD is not ejected as part of the shutdown process.- When you change the selected mode the "Save New Settings" and "Display Last Saved Settings" buttons become active.
- "Save New Settings" or "Display Last Saved Settings"
- Click on "Save New Settings" to commit the displayed dates and the selected mode. These settings become the current saved settings.
- Click on "Display Last Saved Settings" to reset the date controls and Mode radio button to show the current saved settings.
- Close the SetExpirationDate window by clicking on the "X" in it's top right corner.
Note: You MUST download Paraglider's Shutdown Plugin and copy "shutdown.exe" from it to the Expiration Date plugin's "files" folder before you can save the "Shutdown w/ notification." or "Shutdown immediately." mode. Trying to save either mode without doing so results in an error message and the radio button selection is reset to "Hang the system."
Setup Expiration Date using the Command Line interface.
The start date and end date can be set from a command prompt or using a batch file. The syntax is:
SetExpirationDate /x
The start date is set to the system's current date and the end date is set "x" number of days later. For example, if today is December 4, 2004 and you run "SetExpirationDate /4", then the start date will be set to December 4, 2004 and the end date will be set to December 8, 2004.
Notes:
- The start date, end date, and mode are stored in xpr.inf.
- The mode cannot be set using the command line interface.
- If you've never set the mode using the GUI interface it will default to "Hang the system."
Enable Expiration Date
Expiration Date is not enabled when you first download it so be sure to enable it in the plugin list when you run PEBuilder.
Using Expiration Date in combination with Viceroy's Secure Screen plugin.
Secure Screen, by Viceroy, is a well thought out password protection plugin for Bart PE. It includes the following features.
- Allows creating multiple account/password combinations.
- Can be set to require logging in with one of the accounts during the boot process.
- Allows locking the screen. Unlocking requires authentication with an account/password..
- Can be set to allow creation of a temporary account/password when locking the screen.
- Keeping the password truly secure is a design priority.
- Allows an external application to be automatically run either before or after authentication during bootup.
The last item makes it possible to integrate Expiration Date with Secure Screen using the following steps.
- Download Secure Screen from Secure Screen - viceroy's Plugins.
- Decompress and install Secure Screen. Read the documentation: secscr.htm and quickstart.txt.
- Make certain that Secure Screen is prompting for a password during the BartPE boot sequence before continuing!
- Edit preexec.cmd in the Secure Screen plugin folder. Change the lines that read:
set ProgToRun=%SystemRoot%\system32\enter_your_program_here
if exist %ProgToRun% %ProgToRun%to:
set ProgToRun=%SystemRoot%\system32\xpr.exe
if exist %ProgToRun% %ProgToRun% /notify
- Edit ExpirationDate.inf in the ExpirationDate plugin folder.
Comment out (add a semicolon in front of) the line that reads:
files\autorun1-xpr.cmd=2,,1
It becomes:
;files\autorun1-xpr.cmd=2,,1
Using Expiration Date in combination with Sherpya's Xpe Explorer plugin
- If you are using Sherpya's Xpe Explorer as your shell AND you are not using preexec.cmd in the Secure Shell plugin to run xpr.exe, then edit ExpirationDate.inf in the ExpirationDate plugin folder.
Remove the semicolon from the front of the line that reads:
;0x1,"Microsoft\Windows\CurrentVersion\RunOnceEx\409","100","||xpeinit.exe -f xpr.exe"
It becomes:
0x1,"Microsoft\Windows\CurrentVersion\RunOnceEx\409","100","||xpeinit.exe -f xpr.exe"
Requirements
- To shutdown the system rather than have it hang you must download Paraglider's Shutdown Plugin.
- If you are integrating Expiration Date and Secure Shell you obviously need the Secure Screen plugin, but you will also need a visual basic plugin. You can find one at bcording's plugins.
- When BartPE boots it must create a temp environment variable that points to a writeable location. Unless you've disabled it, this is already done by the Ram Drive that comes with PEBuilder.
Thanks
- Thanks to Paraglider for letting me use shutdown.exe from his Shutdown Plugin. This is one of many great plugins he has developed. His web site is at www.paraglidernc.com.
- Thanks to the AutoIt development team and the many people who provide help in the AutoIt forum. Special thanks to bcording and JdeB; Expiration Date uses functions they have made available in the AutoIt Forum's "Scripts and Scraps" section. Check out AutoIt at www.hiddensoft.com and the AutoIt Forum at www.autoitscript.com/forum.