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
7 changes: 7 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,14 @@ jobs:
Copy-Item "files\Encryption Wizard User Guide v405.pdf" "$archiveDir\"
Copy-Item "files\Getting_Started_with_Encryption_Wizard_4.0.005.txt" "$archiveDir\"
Copy-Item "files\Drop_Jar_File_Here_For_Fallback_Launch.bat" "$archiveDir\"
Copy-Item "files\Launch_Encryption_Wizard.bat" "$archiveDir\"
Copy-Item "files\Launch_Encryption_Wizard.ps1" "$archiveDir\"
Copy-Item "files\Launch_Encryption_Wizard.vbs" "$archiveDir\"
Copy-Item "files\Encryption Wizard homepage.url" "$archiveDir\"
Copy-Item "files\Create_Desktop_Shortcut.vbs" "$archiveDir\"
Copy-Item "files\Create_Desktop_Shortcut.ps1" "$archiveDir\"
Copy-Item "files\Create_Desktop_Shortcut.bat" "$archiveDir\"
Copy-Item "files\SHORTCUT_CREATION_README.md" "$archiveDir\"

# Application graphics (icon and splash image)
Copy-Item "build\icon.ico" "$archiveDir\"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,14 @@ jobs:
Copy-Item "files\Encryption Wizard User Guide v405.pdf" "$archiveDir\"
Copy-Item "files\Getting_Started_with_Encryption_Wizard_4.0.005.txt" "$archiveDir\"
Copy-Item "files\Drop_Jar_File_Here_For_Fallback_Launch.bat" "$archiveDir\"
Copy-Item "files\Launch_Encryption_Wizard.bat" "$archiveDir\"
Copy-Item "files\Launch_Encryption_Wizard.ps1" "$archiveDir\"
Copy-Item "files\Launch_Encryption_Wizard.vbs" "$archiveDir\"
Copy-Item "files\Encryption Wizard homepage.url" "$archiveDir\"
Copy-Item "files\Create_Desktop_Shortcut.vbs" "$archiveDir\"
Copy-Item "files\Create_Desktop_Shortcut.ps1" "$archiveDir\"
Copy-Item "files\Create_Desktop_Shortcut.bat" "$archiveDir\"
Copy-Item "files\SHORTCUT_CREATION_README.md" "$archiveDir\"

# Application graphics (icon and splash image)
Copy-Item "build\icon.ico" "$archiveDir\"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,14 @@ jobs:
Copy-Item "files\Encryption Wizard User Guide v405.pdf" "$archiveDir\"
Copy-Item "files\Getting_Started_with_Encryption_Wizard_4.0.005.txt" "$archiveDir\"
Copy-Item "files\Drop_Jar_File_Here_For_Fallback_Launch.bat" "$archiveDir\"
Copy-Item "files\Launch_Encryption_Wizard.bat" "$archiveDir\"
Copy-Item "files\Launch_Encryption_Wizard.ps1" "$archiveDir\"
Copy-Item "files\Launch_Encryption_Wizard.vbs" "$archiveDir\"
Copy-Item "files\Encryption Wizard homepage.url" "$archiveDir\"
Copy-Item "files\Create_Desktop_Shortcut.vbs" "$archiveDir\"
Copy-Item "files\Create_Desktop_Shortcut.ps1" "$archiveDir\"
Copy-Item "files\Create_Desktop_Shortcut.bat" "$archiveDir\"
Copy-Item "files\SHORTCUT_CREATION_README.md" "$archiveDir\"

# Application graphics (icon and splash image)
Copy-Item "build\icon.ico" "$archiveDir\"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,14 @@ jobs:
Copy-Item "files\Encryption Wizard User Guide v405.pdf" "$archiveDir\"
Copy-Item "files\Getting_Started_with_Encryption_Wizard_4.0.005.txt" "$archiveDir\"
Copy-Item "files\Drop_Jar_File_Here_For_Fallback_Launch.bat" "$archiveDir\"
Copy-Item "files\Launch_Encryption_Wizard.bat" "$archiveDir\"
Copy-Item "files\Launch_Encryption_Wizard.ps1" "$archiveDir\"
Copy-Item "files\Launch_Encryption_Wizard.vbs" "$archiveDir\"
Copy-Item "files\Encryption Wizard homepage.url" "$archiveDir\"
Copy-Item "files\Create_Desktop_Shortcut.vbs" "$archiveDir\"
Copy-Item "files\Create_Desktop_Shortcut.ps1" "$archiveDir\"
Copy-Item "files\Create_Desktop_Shortcut.bat" "$archiveDir\"
Copy-Item "files\SHORTCUT_CREATION_README.md" "$archiveDir\"

# Application graphics (icon and splash image)
Copy-Item "build\icon.ico" "$archiveDir\"
Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
# em-win
Encryption Wizard bundling repo for windows that includes a launch4j exe launcher, JRE, and installer

## Features

- Windows installer (Inno Setup) with per-user and system-wide installation options
- Portable ZIP archive with bundled JRE
- Launch4j-generated EXE with embedded JAR
- Desktop shortcut creation utilities for easy access
- File type associations for `.wza`, `.wzd`, and `.wzk` files

## Desktop Shortcut Creation

The bundle includes three utilities to create a desktop shortcut that uses the bundled JRE to launch Encryption Wizard:

- `Create_Desktop_Shortcut.bat` - Batch file (recommended for most users)
- `Create_Desktop_Shortcut.ps1` - PowerShell script
- `Create_Desktop_Shortcut.vbs` - VBScript

Simply double-click any of these files to create a shortcut on your desktop. See `SHORTCUT_CREATION_README.md` for detailed instructions.

## Build Process

The CI/CD workflows automatically:
1. Download and configure a minimal JRE using jlink
2. Build the EXE with Launch4j (embeds the JAR)
3. Create the installer with Inno Setup
4. Package a portable ZIP archive with all necessary files
10 changes: 10 additions & 0 deletions config/installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,19 @@ Source: "..\files\Getting_Started_with_Encryption_Wizard_4.0.005.txt"; DestDir:
; Fallback JAR launcher (for users who already have a JRE in PATH)
Source: "..\files\Drop_Jar_File_Here_For_Fallback_Launch.bat"; DestDir: "{app}"; Flags: ignoreversion

; Direct launchers using bundled JRE
Source: "..\files\Launch_Encryption_Wizard.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\files\Launch_Encryption_Wizard.ps1"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\files\Launch_Encryption_Wizard.vbs"; DestDir: "{app}"; Flags: ignoreversion

; Homepage shortcut
Source: "..\files\Encryption Wizard homepage.url"; DestDir: "{app}"; Flags: ignoreversion

; Desktop shortcut creation utilities
Source: "..\files\Create_Desktop_Shortcut.vbs"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\files\Create_Desktop_Shortcut.ps1"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\files\Create_Desktop_Shortcut.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\files\SHORTCUT_CREATION_README.md"; DestDir: "{app}"; Flags: ignoreversion
; Application graphics (icon and splash image extracted from JAR)
Source: "..\build\icon.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\build\splash.png"; DestDir: "{app}"; Flags: ignoreversion
Expand Down
65 changes: 65 additions & 0 deletions files/Create_Desktop_Shortcut.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
@echo off
REM Batch file to create a Windows desktop shortcut for Encryption Wizard
REM This file uses PowerShell to create the shortcut since batch files cannot
REM directly create .lnk files.
REM
REM Usage: Double-click this file to create a desktop shortcut

setlocal

echo Creating Encryption Wizard desktop shortcut...
echo.

REM Get the directory where this batch file is located
set "SCRIPT_DIR=%~dp0"

REM Remove trailing backslash
if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"

REM Use PowerShell to create the shortcut
powershell -ExecutionPolicy Bypass -NoProfile -Command ^
"$scriptDir = '%SCRIPT_DIR%'; ^
$jarFile = Join-Path $scriptDir 'EW-Unified-4.0.005-FIPS.jar'; ^
$javaExe = Join-Path $scriptDir 'jre\bin\javaw.exe'; ^
$exeFile = Join-Path $scriptDir 'EncryptionWizard.exe'; ^
$workingDir = $scriptDir; ^
$desktopPath = [Environment]::GetFolderPath('Desktop'); ^
$shortcutPath = Join-Path $desktopPath 'Encryption Wizard.lnk'; ^
$shell = New-Object -ComObject WScript.Shell; ^
$shortcut = $shell.CreateShortcut($shortcutPath); ^
if (Test-Path $exeFile) { ^
$shortcut.TargetPath = $exeFile; ^
$shortcut.IconLocation = \"$exeFile,0\"; ^
$shortcut.Description = 'Encryption Wizard - FIPS-compliant encryption application'; ^
Write-Host 'Using EncryptionWizard.exe launcher' -ForegroundColor Green; ^
} elseif ((Test-Path $javaExe) -and (Test-Path $jarFile)) { ^
$shortcut.TargetPath = $javaExe; ^
$shortcut.Arguments = \"-jar `\"$jarFile`\"\"; ^
$shortcut.Description = 'Encryption Wizard - FIPS-compliant encryption application'; ^
$shortcut.IconLocation = \"$jarFile,0\"; ^
Write-Host 'Using bundled JRE to launch JAR' -ForegroundColor Green; ^
} else { ^
Write-Host 'ERROR: Required files not found!' -ForegroundColor Red; ^
Write-Host 'Expected either: EncryptionWizard.exe OR (jre\bin\javaw.exe + EW-Unified-4.0.005-FIPS.jar)'; ^
exit 1; ^
} ^
$shortcut.WorkingDirectory = $workingDir; ^
$shortcut.WindowStyle = 1; ^
$shortcut.Save(); ^
Write-Host ''; ^
Write-Host 'Desktop shortcut created successfully!' -ForegroundColor Green; ^
Write-Host \"Shortcut location: $shortcutPath\"""

if %ERRORLEVEL% EQU 0 (
echo.
echo Success! A shortcut has been created on your desktop.
) else (
echo.
echo Failed to create shortcut. See error message above.
)

echo.
echo Press any key to continue...
pause >nul

endlocal
75 changes: 75 additions & 0 deletions files/Create_Desktop_Shortcut.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# PowerShell script to create a Windows desktop shortcut for Encryption Wizard
# This script creates a shortcut that uses the bundled JRE to launch the JAR file
#
# Usage: Right-click and select "Run with PowerShell"
# or from PowerShell: .\Create_Desktop_Shortcut.ps1
#
# The script assumes it is located in the same directory as:
# - EW-Unified-4.0.005-FIPS.jar
# - jre\ subdirectory (containing the bundled Java Runtime)

# Get the directory where this script is located
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path

# Define paths
$jarFile = Join-Path $scriptDir "EW-Unified-4.0.005-FIPS.jar"
$javaExe = Join-Path $scriptDir "jre\bin\javaw.exe"
$exeFile = Join-Path $scriptDir "EncryptionWizard.exe"
$workingDir = $scriptDir

# Get desktop path
$desktopPath = [Environment]::GetFolderPath("Desktop")
$shortcutPath = Join-Path $desktopPath "Encryption Wizard.lnk"

# Create WScript Shell object for creating shortcuts
$shell = New-Object -ComObject WScript.Shell

# Create the shortcut
$shortcut = $shell.CreateShortcut($shortcutPath)

# Configure shortcut based on what files are available
if (Test-Path $exeFile) {
# If EncryptionWizard.exe exists, use it (it has embedded JAR and icon)
$shortcut.TargetPath = $exeFile
$shortcut.IconLocation = "$exeFile,0"
$shortcut.Description = "Encryption Wizard - FIPS-compliant encryption application"
Write-Host "Using EncryptionWizard.exe launcher" -ForegroundColor Green
}
elseif ((Test-Path $javaExe) -and (Test-Path $jarFile)) {
# Otherwise, use javaw.exe to launch the JAR directly
$shortcut.TargetPath = $javaExe
$shortcut.Arguments = "-jar `"$jarFile`""
$shortcut.Description = "Encryption Wizard - FIPS-compliant encryption application"
# Try to use the JAR file itself as icon source (some JARs have embedded icons)
$shortcut.IconLocation = "$jarFile,0"
Write-Host "Using bundled JRE to launch JAR" -ForegroundColor Green
}
else {
Write-Host "ERROR: Required files not found!" -ForegroundColor Red
Write-Host ""
Write-Host "Expected either:"
Write-Host " - EncryptionWizard.exe"
Write-Host "OR"
Write-Host " - jre\bin\javaw.exe"
Write-Host " - EW-Unified-4.0.005-FIPS.jar"
Write-Host ""
Write-Host "in directory: $scriptDir"
exit 1
}

$shortcut.WorkingDirectory = $workingDir
$shortcut.WindowStyle = 1 # Normal window
$shortcut.Save()

Write-Host ""
Write-Host "Desktop shortcut created successfully!" -ForegroundColor Green
Write-Host "Shortcut location: $shortcutPath"
Write-Host ""
if ($Host.UI.RawUI) {
Write-Host "Press any key to continue..."
try {
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
} catch {
Start-Sleep -Seconds 2
}
}
73 changes: 73 additions & 0 deletions files/Create_Desktop_Shortcut.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
' VBScript to create a Windows desktop shortcut for Encryption Wizard
' This script creates a shortcut that uses the bundled JRE to launch the JAR file
'
' Usage: Double-click this file or run: wscript Create_Desktop_Shortcut.vbs
'
' The script assumes it is located in the same directory as:
' - EW-Unified-4.0.005-FIPS.jar
' - jre\ subdirectory (containing the bundled Java Runtime)

Option Explicit

Dim objShell, objFSO, objShortcut
Dim strScriptDir, strDesktopPath, strShortcutPath
Dim strJavaExe, strJarFile, strWorkingDir, strIconFile

' Create shell and file system objects
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

' Get the directory where this script is located
strScriptDir = objFSO.GetParentFolderName(WScript.ScriptFullName)

' Define paths
strJarFile = objFSO.BuildPath(strScriptDir, "EW-Unified-4.0.005-FIPS.jar")
strJavaExe = objFSO.BuildPath(strScriptDir, "jre\bin\javaw.exe")
strWorkingDir = strScriptDir

' Check if EncryptionWizard.exe exists (from Launch4j build)
Dim strExeFile
strExeFile = objFSO.BuildPath(strScriptDir, "EncryptionWizard.exe")

' Get desktop path
strDesktopPath = objShell.SpecialFolders("Desktop")
strShortcutPath = objFSO.BuildPath(strDesktopPath, "Encryption Wizard.lnk")

' Create the shortcut
Set objShortcut = objShell.CreateShortcut(strShortcutPath)

' If EncryptionWizard.exe exists, use it (it has embedded JAR and icon)
If objFSO.FileExists(strExeFile) Then
objShortcut.TargetPath = strExeFile
objShortcut.IconLocation = strExeFile & ",0"
objShortcut.Description = "Encryption Wizard - FIPS-compliant encryption application"
' Otherwise, use javaw.exe to launch the JAR directly
ElseIf objFSO.FileExists(strJavaExe) And objFSO.FileExists(strJarFile) Then
objShortcut.TargetPath = strJavaExe
objShortcut.Arguments = "-jar """ & strJarFile & """"
objShortcut.Description = "Encryption Wizard - FIPS-compliant encryption application"
' Try to use the JAR file itself as icon source (some JARs have embedded icons)
objShortcut.IconLocation = strJarFile & ",0"
Else
WScript.Echo "ERROR: Required files not found!" & vbCrLf & vbCrLf & _
"Expected either:" & vbCrLf & _
" - EncryptionWizard.exe" & vbCrLf & _
"OR" & vbCrLf & _
" - jre\bin\javaw.exe" & vbCrLf & _
" - EW-Unified-4.0.005-FIPS.jar" & vbCrLf & vbCrLf & _
"in directory: " & strScriptDir
WScript.Quit 1
End If

objShortcut.WorkingDirectory = strWorkingDir
objShortcut.WindowStyle = 1 ' Normal window
objShortcut.Save

' Success message
WScript.Echo "Desktop shortcut created successfully!" & vbCrLf & vbCrLf & _
"Shortcut location: " & strShortcutPath

' Cleanup
Set objShortcut = Nothing
Set objFSO = Nothing
Set objShell = Nothing
63 changes: 63 additions & 0 deletions files/Launch_Encryption_Wizard.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@echo off
REM Launcher for Encryption Wizard using the bundled JRE
REM This script launches the Encryption Wizard JAR file using the local JRE
REM located in the jre/ subdirectory.
REM
REM Usage: Double-click this file or run from command line with optional arguments
REM Launch_Encryption_Wizard.bat [arguments for Encryption Wizard]
REM
REM This script expects to find:
REM - jre\bin\java.exe (bundled Java Runtime)
REM - EW-Unified-4.0.005-FIPS.jar (the application JAR)

setlocal enableextensions

REM Get the directory where this script is located
set "SCRIPT_DIR=%~dp0"

REM Remove trailing backslash
if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"

REM Define paths
set "JAVA_EXE=%SCRIPT_DIR%\jre\bin\java.exe"
set "JAR_FILE=%SCRIPT_DIR%\EW-Unified-4.0.005-FIPS.jar"

REM Check if the bundled JRE exists
if not exist "%JAVA_EXE%" (
echo ERROR: Bundled JRE not found!
echo Expected location: %JAVA_EXE%
echo.
echo Please ensure the jre directory is in the same location as this script.
echo.
pause
exit /b 1
)

REM Check if the JAR file exists
if not exist "%JAR_FILE%" (
echo ERROR: Encryption Wizard JAR file not found!
echo Expected location: %JAR_FILE%
echo.
echo Please ensure EW-Unified-4.0.005-FIPS.jar is in the same location as this script.
echo.
pause
exit /b 1
)

REM Launch the application with the bundled JRE
REM Pass all command line arguments to the application
"%JAVA_EXE%" -jar "%JAR_FILE%" %*

REM Capture the exit code
set EXITCODE=%ERRORLEVEL%

REM Pause only if there was an error (non-zero exit code)
if %EXITCODE% neq 0 (
echo.
echo Encryption Wizard exited with code: %EXITCODE%
echo.
pause
)

endlocal
exit /b %EXITCODE%
Loading
Loading