Add JT2GO, NetworkDriveManager, and Template projects

JT2GO:
- Inno Setup installer for JT2Go with prerequisite checking
- Checks for VC++ x86/x64 redistributables and .NET 4.8
- Verifies admin privileges before installation
- Supports silent installation mode

NetworkDriveManager:
- Full Inno Setup implementation with integrated PowerShell logic
- Menu-based interface for managing legacy domain network drives
- Features: backup/restore mappings, credential testing, drive reset
- Server migration from rd.ds.ge.com to wjs.geaerospace.net
- Three-phase reconnection to prevent error 1219 with multiple shares
- Add predefined drives (S:, V:, Y:) functionality

Template:
- Reusable Inno Setup project template for co-workers
- Documented sections with examples and best practices
- Includes utility functions and common patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-01-19 16:07:07 -05:00
parent 28541cd3ed
commit 691c6f9656
18 changed files with 7664 additions and 0 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
*.exe *.exe
*.zip
*.msi
Output/ Output/
.claude/ .claude/

129
JT2GO/CustomInstall.bat Normal file
View File

@@ -0,0 +1,129 @@
@echo off
rem --------------------------------------------------------------------
rem
rem This script provides a template for customizing and launching the
rem JT2Go 2512 installer. Controlling the installer in this manner will:
rem
rem * allow for preselection of features to be installed
rem * prefill required fields (e.g. licensing options)
rem * ease deployment to a large number of users.
rem
rem To use this script, simply uncomment and fill in the proper options
rem below, and choose the proper options for the install, or feel free
rem to otherwise modify it to fit your situation.
rem
rem For some Windows Installer options, there are more possible values than
rem are listed here. For the complete Windows Installer command line reference, see
rem http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/command_line_options.asp
rem
rem --------------------------------------------------------------------
setlocal
set EXEFILE=JT2GoSetup.exe
set OPTIONS=
rem --------------------------------------------------------------------
rem Silent mode. OPT1 is for the .exe wrapper, OPT2 is standard Windows
rem Installer silent mode option. Both must be set.
rem --------------------------------------------------------------------
rem set SILENTOPT1=/S &set SILENTOPT2=/qb
rem --------------------------------------------------------------------
rem Installer logging
rem --------------------------------------------------------------------
rem set OPTIONS=%OPTIONS% -l*v C:\temp\JT2GoIns.log
rem --------------------------------------------------------------------
rem set the language in which to run the installer
rem --------------------------------------------------------------------
set ILANG=/L1033 &rem English
rem set ILANG=/L1036 &rem French (Standard)
rem set ILANG=/L1031 &rem German
rem set ILANG=/L1040 &rem Italian (Standard)
rem set ILANG=/L1034 &rem Spanish - Traditional Sort
rem set ILANG=/L1029 &rem Czech
rem set ILANG=/L1045 &rem Polish
rem set ILANG=/L1046 &rem Portuguese (Brazil)
rem set ILANG=/L1049 &rem Russian
rem set ILANG=/L1041 &rem Japanese
rem set ILANG=/L1042 &rem Korean
rem set ILANG=/L1052 &rem Chinese (Simplified/PRC)
rem set ILANG=/L1028 &rem Chinese (Traditional/Taiwan)
rem --------------------------------------------------------------------
rem Set the Install-to directory
rem --------------------------------------------------------------------
rem set OPTIONS=%OPTIONS% INSTALLTO=\"C:\Program Files\Siemens\JT2Go\"
rem --------------------------------------------------------------------
rem set foreign language localizations to be installed (optional)
rem --------------------------------------------------------------------
rem set OPTIONS=%OPTIONS% INSTALL_SPANISH=1
rem set OPTIONS=%OPTIONS% INSTALL_GERMAN=1
rem set OPTIONS=%OPTIONS% INSTALL_FRENCH=1
rem set OPTIONS=%OPTIONS% INSTALL_ITALIAN=1
rem set OPTIONS=%OPTIONS% INSTALL_CZECH=1
rem set OPTIONS=%OPTIONS% INSTALL_PORTUGUESE=1
rem set OPTIONS=%OPTIONS% INSTALL_POLISH=1
rem set OPTIONS=%OPTIONS% INSTALL_JAPANESE=1
rem set OPTIONS=%OPTIONS% INSTALL_KOREAN=1
rem set OPTIONS=%OPTIONS% INSTALL_SCHINESE=1
rem set OPTIONS=%OPTIONS% INSTALL_TCHINESE=1
rem set OPTIONS=%OPTIONS% INSTALL_RUSSIAN=1
rem --------------------------------------------------------------------
rem Install a Desktop Shortcut. 1=yes, 0=no. Default=1
rem --------------------------------------------------------------------
rem set OPTIONS=%OPTIONS% DT_SHORTCUT=0
rem --------------------------------------------------------------------
rem Disable internet connection for JT2Go session. 1=yes, 0=no. Default=0
rem --------------------------------------------------------------------
rem set OPTIONS=%OPTIONS% DISABLE_INTERNET=1
rem --------------------------------------------------------------------
rem Disable automatic updates. 1=yes, 0=no. Default=0
rem --------------------------------------------------------------------
rem set OPTIONS=%OPTIONS% DISABLE_UPDATES=1
rem --------------------------------------------------------------------
rem set initial behavior for the Teamcenter Visualization Product Excellence Program
rem Valid values are:
rem 0: UI enabled, checkbox off (Product Excellence Program disabled, end user can change thru UI)
rem 1: UI disabled, checkbox off (Product Excellence Program disabled, end user cannot change)
rem 2: UI enabled, checkbox on (Product Excellence Program enabled, end user can change thru UI)
rem 3: UI disabled, checkbox on (Product Excellence Program enabled, end user cannot change)
rem --------------------------------------------------------------------
rem set OPTIONS=%OPTIONS% JT2GO_PEP_INIT=1
rem --------------------------------------------------------------------
rem Location of configuration file (optional)
rem Either use a UNC path to the version specific CONFIG_JT2Go file, or copy it locally.
rem --------------------------------------------------------------------
rem set OPTIONS=%OPTIONS% CONFIG="C:\temp\myConfig"
rem --------------------------------------------------------------------
rem Enable installer-time import of default registry settings. 1=yes, 0=no. Default=0
rem If not installed at install time, launching JT2Go for the first
rem time will import them anyway using regedit.
rem --------------------------------------------------------------------
rem set OPTIONS=%OPTIONS% IMPORTDEFAULTREG=1
rem launch the installer
%EXEFILE% %ILANG% %SILENTOPT1% /v"%SILENTOPT2% %OPTIONS%"
endlocal

504
JT2GO/JT2GO.iss Normal file
View File

@@ -0,0 +1,504 @@
; JT2Go Installer with Prerequisite Checks
; Checks and installs VC++ Redistributables (x86/x64) and .NET Framework 4.8
; Supports silent installation: /VERYSILENT /SUPPRESSMSGBOXES
; Version 1.1
[Setup]
AppId={{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}
AppName=Siemens JT2Go
AppVersion=2512
AppPublisher=WJDT
AppPublisherURL=https://www.plm.automation.siemens.com
DefaultDirName={autopf}\Siemens\JT2Go
CreateAppDir=no
PrivilegesRequired=admin
OutputDir=.\Output
OutputBaseFilename=JT2Go_Installer_v2512
SolidCompression=yes
WizardStyle=modern
SetupIconFile=gea-logo.ico
WizardImageFile=patrick.bmp
WizardSmallImageFile=patrick-sm.bmp
DisableWelcomePage=no
DisableDirPage=yes
DisableProgramGroupPage=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Messages]
WelcomeLabel2=This will install Siemens JT2Go 2512 on your computer.%n%nThe installer will automatically check for and install the following prerequisites if needed:%n%n - Microsoft Visual C++ Redistributable (x86)%n - Microsoft Visual C++ Redistributable (x64)%n - Microsoft .NET Framework 4.8%n%nAdministrative privileges are required.
[Files]
; Include all prerequisite installers
Source: "VC_redist.x86.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall
Source: "VC_redist.x64.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall
Source: "NDP48-x86-x64-AllOS-ENU.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall
Source: "JT2GoSetup.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall
[Code]
var
ProgressPage: TOutputProgressWizardPage;
PrereqPage: TOutputMsgMemoWizardPage;
VCx86Needed, VCx64Needed, DotNetNeeded: Boolean;
PrereqSummary: String;
RebootRequired: Boolean;
// ============================================
// Silent-aware message box wrapper
// ============================================
procedure ShowMessage(Msg: String; MsgType: TMsgBoxType);
begin
if not WizardSilent then
MsgBox(Msg, MsgType, MB_OK);
end;
// ============================================
// Registry Detection Functions
// ============================================
// Check if VC++ 2015-2022 x64 Redistributable is installed
function IsVCx64Installed: Boolean;
var
Installed: Cardinal;
begin
Result := False;
// Check primary registry location for VC++ 2015-2022 x64
if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Installed', Installed) then
begin
Result := (Installed = 1);
end;
// Also check newer registry path
if not Result then
begin
if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\X64', 'Installed', Installed) then
begin
Result := (Installed = 1);
end;
end;
end;
// Check if VC++ 2015-2022 x86 Redistributable is installed
function IsVCx86Installed: Boolean;
var
Installed: Cardinal;
begin
Result := False;
// On 64-bit Windows, x86 registry is in Wow6432Node
if IsWin64 then
begin
if RegQueryDWordValue(HKLM, 'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x86', 'Installed', Installed) then
begin
Result := (Installed = 1);
end;
if not Result then
begin
if RegQueryDWordValue(HKLM, 'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\X86', 'Installed', Installed) then
begin
Result := (Installed = 1);
end;
end;
end
else
begin
// On 32-bit Windows
if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86', 'Installed', Installed) then
begin
Result := (Installed = 1);
end;
end;
end;
// Check if .NET Framework 4.8 or later is installed
function IsDotNet48Installed: Boolean;
var
Release: Cardinal;
begin
Result := False;
// .NET Framework 4.8 has release key >= 528040
// 528040 = Windows 10 May 2019 Update
// 528049 = All other Windows versions
if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', Release) then
begin
Result := (Release >= 528040);
end;
end;
// ============================================
// Check Prerequisites (called early for silent mode)
// ============================================
procedure CheckPrerequisites;
begin
VCx86Needed := not IsVCx86Installed;
VCx64Needed := not IsVCx64Installed;
DotNetNeeded := not IsDotNet48Installed;
RebootRequired := False;
end;
// ============================================
// Wizard Page Setup
// ============================================
procedure InitializeWizard();
begin
// Create progress page for prerequisite installation
ProgressPage := CreateOutputProgressPage('Installing Prerequisites',
'Please wait while the required components are being installed...');
// Create prerequisites summary page (only shown in non-silent mode)
PrereqPage := CreateOutputMsgMemoPage(wpWelcome,
'Prerequisites Check',
'The installer has checked for required components.',
'Status of required prerequisites:',
'');
end;
// ============================================
// Prerequisites Check on Welcome Page
// ============================================
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
if CurPageID = wpWelcome then
begin
// Check all prerequisites
CheckPrerequisites;
// Build summary text
PrereqSummary := '';
PrereqSummary := PrereqSummary + 'Visual C++ Redistributable (x86): ';
if VCx86Needed then
PrereqSummary := PrereqSummary + 'NOT INSTALLED - Will be installed'#13#10
else
PrereqSummary := PrereqSummary + 'Already installed'#13#10;
PrereqSummary := PrereqSummary + #13#10'Visual C++ Redistributable (x64): ';
if VCx64Needed then
PrereqSummary := PrereqSummary + 'NOT INSTALLED - Will be installed'#13#10
else
PrereqSummary := PrereqSummary + 'Already installed'#13#10;
PrereqSummary := PrereqSummary + #13#10'.NET Framework 4.8: ';
if DotNetNeeded then
PrereqSummary := PrereqSummary + 'NOT INSTALLED - Will be installed'#13#10
else
PrereqSummary := PrereqSummary + 'Already installed'#13#10;
PrereqSummary := PrereqSummary + #13#10'-------------------------------------------'#13#10;
if VCx86Needed or VCx64Needed or DotNetNeeded then
PrereqSummary := PrereqSummary + #13#10'Missing prerequisites will be installed before JT2Go.'#13#10 +
'This may require a system restart if .NET Framework 4.8 is installed.'
else
PrereqSummary := PrereqSummary + #13#10'All prerequisites are already installed.'#13#10 +
'JT2Go installation will proceed directly.';
// Update the prereq page memo
PrereqPage.RichEditViewer.RTFText := PrereqSummary;
end;
end;
// ============================================
// Install Prerequisites Function
// ============================================
function InstallPrerequisites: Boolean;
var
ResultCode: Integer;
ErrorMsg: String;
begin
Result := True;
if not WizardSilent then
ProgressPage.Show;
try
// ============================================
// Install VC++ x86 if needed
// ============================================
if VCx86Needed then
begin
if not WizardSilent then
begin
ProgressPage.SetText('Installing Visual C++ Redistributable (x86)...',
'This may take a few moments...');
ProgressPage.SetProgress(1, 4);
end;
// Run VC_redist.x86.exe with silent install
// /install /quiet /norestart
if not Exec(ExpandConstant('{tmp}\VC_redist.x86.exe'), '/install /quiet /norestart', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
ErrorMsg := 'Failed to launch VC++ x86 installer.';
ShowMessage(ErrorMsg, mbError);
Result := False;
Exit;
end;
// Check result code (0 = success, 3010 = success but reboot needed)
if (ResultCode <> 0) and (ResultCode <> 3010) then
begin
ErrorMsg := 'VC++ x86 installation failed with error code: ' + IntToStr(ResultCode);
ShowMessage(ErrorMsg, mbError);
Result := False;
Exit;
end;
if ResultCode = 3010 then
RebootRequired := True;
end;
// ============================================
// Install VC++ x64 if needed
// ============================================
if VCx64Needed then
begin
if not WizardSilent then
begin
ProgressPage.SetText('Installing Visual C++ Redistributable (x64)...',
'This may take a few moments...');
ProgressPage.SetProgress(2, 4);
end;
if not Exec(ExpandConstant('{tmp}\VC_redist.x64.exe'), '/install /quiet /norestart', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
ErrorMsg := 'Failed to launch VC++ x64 installer.';
ShowMessage(ErrorMsg, mbError);
Result := False;
Exit;
end;
if (ResultCode <> 0) and (ResultCode <> 3010) then
begin
ErrorMsg := 'VC++ x64 installation failed with error code: ' + IntToStr(ResultCode);
ShowMessage(ErrorMsg, mbError);
Result := False;
Exit;
end;
if ResultCode = 3010 then
RebootRequired := True;
end;
// ============================================
// Install .NET Framework 4.8 if needed
// ============================================
if DotNetNeeded then
begin
if not WizardSilent then
begin
ProgressPage.SetText('Installing .NET Framework 4.8...',
'This may take several minutes. Please wait...');
ProgressPage.SetProgress(3, 4);
end;
// Run .NET installer with silent install
// /q /norestart
if not Exec(ExpandConstant('{tmp}\NDP48-x86-x64-AllOS-ENU.exe'), '/q /norestart', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
ErrorMsg := 'Failed to launch .NET Framework 4.8 installer.';
ShowMessage(ErrorMsg, mbError);
Result := False;
Exit;
end;
// Check result codes
// 0 = success
// 3010 = success, reboot required
// 1641 = success, reboot initiated
// 1602 = user cancelled
// 1603 = fatal error
// 5100 = computer does not meet requirements
case ResultCode of
0:
begin
// Success, no reboot needed
end;
3010, 1641:
begin
// Success but reboot required
RebootRequired := True;
end;
1602:
begin
ErrorMsg := '.NET Framework installation was cancelled.';
ShowMessage(ErrorMsg, mbError);
Result := False;
Exit;
end;
5100:
begin
ErrorMsg := 'This computer does not meet the requirements for .NET Framework 4.8.';
ShowMessage(ErrorMsg, mbError);
Result := False;
Exit;
end;
else
begin
ErrorMsg := '.NET Framework 4.8 installation failed with error code: ' + IntToStr(ResultCode);
ShowMessage(ErrorMsg, mbError);
Result := False;
Exit;
end;
end;
end;
if not WizardSilent then
ProgressPage.SetProgress(4, 4);
finally
if not WizardSilent then
ProgressPage.Hide;
end;
end;
// ============================================
// Main Installation Step
// ============================================
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: Integer;
JT2GoExe: String;
JT2GoParams: String;
WorkDir: String;
ShowWindow: Integer;
begin
if CurStep = ssPostInstall then
begin
// For silent mode, check prerequisites here since wizard pages are skipped
if WizardSilent then
CheckPrerequisites;
// First, install prerequisites if needed
if VCx86Needed or VCx64Needed or DotNetNeeded then
begin
if not InstallPrerequisites then
begin
// Prerequisite installation failed
Exit;
end;
end;
// Check if reboot is required before continuing
if RebootRequired then
begin
ShowMessage('.NET Framework 4.8 was installed successfully.' + #13#10 +
'A system restart is required to complete the installation.' + #13#10#13#10 +
'Please restart your computer and run this installer again to complete JT2Go installation.',
mbInformation);
Exit;
end;
// Now run the JT2Go installer
if not WizardSilent then
begin
ProgressPage.SetText('Installing JT2Go 2512...',
'The JT2Go installer will now launch. Please follow its prompts.');
ProgressPage.SetProgress(1, 1);
ProgressPage.Show;
end;
try
JT2GoExe := ExpandConstant('{tmp}\JT2GoSetup.exe');
WorkDir := ExpandConstant('{tmp}');
// Determine parameters based on silent mode
if WizardSilent then
begin
// Silent installation of JT2Go
// /S = silent for exe wrapper, /qn = quiet no UI for MSI
JT2GoParams := '/L1033 /S /v"/qn /norestart"';
ShowWindow := SW_HIDE;
end
else
begin
// Interactive installation - just set language to English
JT2GoParams := '/L1033';
ShowWindow := SW_SHOW;
end;
// Execute JT2Go installer directly (not via batch file for better control)
if not Exec(JT2GoExe, JT2GoParams, WorkDir, ShowWindow, ewWaitUntilTerminated, ResultCode) then
begin
ShowMessage('Failed to launch JT2Go installer.' + #13#10 +
'Please run JT2GoSetup.exe manually from the installation files.',
mbError);
Exit;
end;
// Check result
if ResultCode <> 0 then
begin
// Non-zero doesn't always mean failure for installers
// 0 = success, 3010 = success with reboot required
if ResultCode = 3010 then
begin
ShowMessage('Installation Complete!' + #13#10#13#10 +
'JT2Go 2512 has been installed successfully.' + #13#10 +
'A system restart may be required.',
mbInformation);
end
else
begin
ShowMessage('JT2Go installation completed with exit code: ' + IntToStr(ResultCode) + #13#10#13#10 +
'Please verify JT2Go is installed correctly.',
mbInformation);
end;
end
else
begin
ShowMessage('Installation Complete!' + #13#10#13#10 +
'JT2Go 2512 has been installed successfully.' + #13#10#13#10 +
'All prerequisites were verified/installed:' + #13#10 +
' - Visual C++ Redistributable (x86)' + #13#10 +
' - Visual C++ Redistributable (x64)' + #13#10 +
' - .NET Framework 4.8',
mbInformation);
end;
finally
if not WizardSilent then
ProgressPage.Hide;
end;
end;
end;
// ============================================
// Initialization - Admin Check
// ============================================
function InitializeSetup(): Boolean;
begin
Result := True;
RebootRequired := False;
// Additional admin check at runtime
// Note: PrivilegesRequired=admin already enforces this, but this provides a clearer message
if not IsAdmin then
begin
ShowMessage('Administrator Privileges Required' + #13#10#13#10 +
'This installer must be run with administrative privileges.' + #13#10#13#10 +
'Please right-click the installer and select "Run as administrator".',
mbError);
Result := False;
Exit;
end;
end;
// ============================================
// Return proper exit code for reboot scenarios
// ============================================
function NeedRestart(): Boolean;
begin
Result := RebootRequired;
end;

File diff suppressed because one or more lines are too long

BIN
JT2GO/gea-logo.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

28
JT2GO/issues.txt Normal file
View File

@@ -0,0 +1,28 @@
December 5, 2025 Release
JT2Go_2512 PRs/ERs:
PR Summary
-------------------------------------------------------
N/A
TcVis_2512 PRs/ERs: (PRs/ERs that apply to JT2Go)
PR Summary
-------------------------------------------------------
11296488 TcVis "Rotate around a user defined point" not returning back to default rotation
11301685 TcVis: Applying a Snapshot with Markups selects a Markup
11308387 TcVis Rotate around a user defined point showing with a single click after selecting PMI
11319895 Header not displayed correctly
11348333 (2412 Ext) Unintended seek when using middle mouse button to pan view of clipped 3D section
11348754 TcVis: Contextual Menu has two Seek options after creating an Animation
11356872 The option Turn Off disappears and two Seek options are now available when switching windows in TcVis
11357263 TcVis: Applying Snapshot does not turn off parts from previous Snapshot
11361094 (2406 Ext) TcVis selecting random parts in assembly tree
11369816 In TcVis, opening an assembly with a custom ref set. Select the assembly will select all of the components, but Entire Part cannot be selected because it is already defaulted to that at Assy level.

BIN
JT2GO/patrick-sm.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
JT2GO/patrick.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

125
Template/README.md Normal file
View File

@@ -0,0 +1,125 @@
# Inno Setup Project Template
A starting point for creating Windows installers with Inno Setup.
## Quick Start
1. **Copy this folder** to a new location and rename it for your project
2. **Rename `Template.iss`** to `YourProjectName.iss`
3. **Generate a new GUID** for `AppId` (Tools > Generate GUID in Inno Setup)
4. **Update the `[Setup]` section** with your app name, version, publisher, etc.
5. **Add your files** to the `[Files]` section
6. **Compile** with Inno Setup Compiler (right-click > Compile)
## Files Included
| File | Description |
|------|-------------|
| `Template.iss` | Main Inno Setup script with examples |
| `gea-logo.ico` | Setup icon (replace with your own) |
| `banner.bmp` | Wizard banner image (164x314 pixels) |
| `banner-sm.bmp` | Wizard small image (55x58 pixels) |
| `README.md` | This file |
## Common Tasks
### Install Files
```iss
[Files]
Source: "MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Data\*"; DestDir: "{app}\Data"; Flags: ignoreversion recursesubdirs
```
### Create Shortcuts
```iss
[Icons]
Name: "{group}\My App"; Filename: "{app}\MyApp.exe"
Name: "{userdesktop}\My App"; Filename: "{app}\MyApp.exe"; Tasks: desktopicon
```
### Run After Install
```iss
[Run]
Filename: "{app}\MyApp.exe"; Description: "Launch My App"; Flags: postinstall nowait
```
### Check Prerequisites
```pascal
function InitializeSetup: Boolean;
begin
Result := True;
if not IsDotNet48Installed then
begin
MsgBox('.NET Framework 4.8 is required.', mbError, MB_OK);
Result := False;
end;
end;
```
### Execute PowerShell
```pascal
var
Output: String;
begin
ExecPowerShell('Get-Process | Select-Object -First 5', Output);
ShowResultsDialog('Processes', Output);
end;
```
### Silent Installation
```batch
:: Silent install
MySetup.exe /VERYSILENT /SUPPRESSMSGBOXES
:: Silent install with log
MySetup.exe /VERYSILENT /LOG="C:\install.log"
:: Silent uninstall
MySetup.exe /VERYSILENT /UNINSTALL
```
## Useful Constants
| Constant | Description | Example |
|----------|-------------|---------|
| `{app}` | Application directory | `C:\Program Files\MyApp` |
| `{tmp}` | Temporary directory | `C:\Users\X\AppData\Local\Temp\is-XXXXX` |
| `{userdesktop}` | User's desktop | `C:\Users\X\Desktop` |
| `{userdocs}` | User's documents | `C:\Users\X\Documents` |
| `{commonpf}` | Program Files | `C:\Program Files` |
| `{commonpf32}` | Program Files (x86) | `C:\Program Files (x86)` |
| `{autopf}` | Auto Program Files | Picks 32/64-bit automatically |
| `{win}` | Windows directory | `C:\Windows` |
| `{sys}` | System32 directory | `C:\Windows\System32` |
| `{src}` | Setup source directory | Where setup.exe is located |
| `{group}` | Start Menu folder | `C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MyApp` |
## Privileges
```iss
; Requires admin (for Program Files installs)
PrivilegesRequired=admin
; User-level only (no elevation)
PrivilegesRequired=lowest
; Try admin, fall back to user
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
```
## Resources
- [Inno Setup Documentation](https://jrsoftware.org/ishelp/)
- [Inno Setup Download](https://jrsoftware.org/isdl.php)
- [Pascal Scripting Reference](https://jrsoftware.org/ishelp/index.php?topic=scriptintro)
## Author
WJDT / GE Aerospace

463
Template/Template.iss Normal file
View File

@@ -0,0 +1,463 @@
; ============================================================================
; INNO SETUP PROJECT TEMPLATE
; ============================================================================
;
; This template provides a starting point for creating Inno Setup installers.
; It includes common patterns, examples, and best practices.
;
; HOW TO USE THIS TEMPLATE:
; 1. Copy this entire folder to a new location
; 2. Rename Template.iss to YourProjectName.iss
; 3. Search for "TODO:" comments and update as needed
; 4. Add your files to the project folder
; 5. Compile with Inno Setup Compiler
;
; REQUIREMENTS:
; - Inno Setup 6.x or later (https://jrsoftware.org/isinfo.php)
; - Optional: Add gea-logo.ico, banner.bmp, banner-sm.bmp for branding
;
; Author: WJDT / GE Aerospace
; Version: 1.0
; ============================================================================
; ============================================================================
; [Setup] - Basic installer configuration
; ============================================================================
[Setup]
; TODO: Generate a unique GUID for your app (Tools > Generate GUID in Inno Setup)
AppId={{YOUR-UNIQUE-GUID-HERE}}
; TODO: Update these with your application details
AppName=My Application Name
AppVersion=1.0
AppPublisher=WJDT
AppPublisherURL=https://www.geaerospace.com
AppSupportURL=https://www.geaerospace.com
AppUpdatesURL=https://www.geaerospace.com
; Installation directory (use {autopf} for Program Files, auto-selects 32/64-bit)
DefaultDirName={autopf}\My Application
; Start menu folder name
DefaultGroupName=My Application
; Output settings
OutputDir=Output
OutputBaseFilename=MyApplicationSetup_v1.0
; Compression
SolidCompression=yes
Compression=lzma2
; Visual style
WizardStyle=modern
; Branding (included in template - replace with your own)
SetupIconFile=gea-logo.ico
WizardImageFile=banner.bmp
WizardSmallImageFile=banner-sm.bmp
; Privileges: admin = requires elevation, lowest = current user only
; Use 'admin' for Program Files installs, 'lowest' for user-specific tools
PrivilegesRequired=admin
; Other common options
DisableWelcomePage=no
DisableDirPage=no
DisableProgramGroupPage=no
AllowNoIcons=yes
; Uninstall settings
Uninstallable=yes
CreateUninstallRegKey=yes
; ============================================================================
; [Languages] - Supported languages
; ============================================================================
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
; Uncomment for additional languages:
; Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
; Name: "french"; MessagesFile: "compiler:Languages\French.isl"
; Name: "german"; MessagesFile: "compiler:Languages\German.isl"
; ============================================================================
; [Messages] - Custom message overrides
; ============================================================================
[Messages]
; TODO: Customize the welcome page text
WelcomeLabel2=This will install [name] version [ver] on your computer.%n%nIt is recommended that you close all other applications before continuing.%n%nClick Next to continue, or Cancel to exit Setup.
; ============================================================================
; [Tasks] - Optional installation tasks (checkboxes)
; ============================================================================
[Tasks]
Name: "desktopicon"; Description: "Create a &desktop shortcut"; GroupDescription: "Additional shortcuts:"; Flags: unchecked
Name: "quicklaunchicon"; Description: "Create a &Quick Launch shortcut"; GroupDescription: "Additional shortcuts:"; Flags: unchecked
; Example: Optional component
; Name: "installextra"; Description: "Install optional components"; GroupDescription: "Components:"
; ============================================================================
; [Files] - Files to install
; ============================================================================
[Files]
; TODO: Add your application files here
;
; Common flags:
; ignoreversion - Always overwrite regardless of version
; recursesubdirs - Include subdirectories
; createallsubdirs - Create empty subdirectories too
; deleteafterinstall - Delete after install (for temp files)
;
; Examples:
; Source: "MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion
; Source: "MyApp.dll"; DestDir: "{app}"; Flags: ignoreversion
; Source: "Data\*"; DestDir: "{app}\Data"; Flags: ignoreversion recursesubdirs createallsubdirs
; Source: "README.txt"; DestDir: "{app}"; Flags: ignoreversion isreadme
; ============================================================================
; [Dirs] - Directories to create
; ============================================================================
[Dirs]
; Example: Create a data directory with specific permissions
; Name: "{app}\Data"; Permissions: users-modify
; Name: "{commonappdata}\MyApp"; Permissions: users-modify
; ============================================================================
; [Icons] - Shortcuts to create
; ============================================================================
[Icons]
; Start Menu shortcut
; Name: "{group}\My Application"; Filename: "{app}\MyApp.exe"; WorkingDir: "{app}"
; Desktop shortcut (only if task selected)
; Name: "{userdesktop}\My Application"; Filename: "{app}\MyApp.exe"; WorkingDir: "{app}"; Tasks: desktopicon
; Uninstall shortcut in Start Menu
; Name: "{group}\Uninstall My Application"; Filename: "{uninstallexe}"
; ============================================================================
; [Registry] - Registry entries
; ============================================================================
[Registry]
; Examples:
; Root: HKLM; Subkey: "Software\MyCompany\MyApp"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"; Flags: uninsdeletekey
; Root: HKCU; Subkey: "Software\MyCompany\MyApp"; ValueType: dword; ValueName: "SomeOption"; ValueData: "1"
; ============================================================================
; [INI] - INI file entries
; ============================================================================
[INI]
; Example: Create an INI file
; Filename: "{app}\MyApp.ini"; Section: "Settings"; Key: "Language"; String: "en"
; ============================================================================
; [Run] - Programs to run after installation
; ============================================================================
[Run]
; Example: Launch app after install (optional, user can uncheck)
; Filename: "{app}\MyApp.exe"; Description: "Launch My Application"; Flags: nowait postinstall skipifsilent
; Example: Run a configuration script
; Filename: "{cmd}"; Parameters: "/c ""{app}\configure.bat"""; Flags: runhidden waituntilterminated
; ============================================================================
; [UninstallRun] - Programs to run during uninstall
; ============================================================================
[UninstallRun]
; Example: Run cleanup script before uninstall
; Filename: "{app}\cleanup.bat"; Flags: runhidden waituntilterminated
; ============================================================================
; [UninstallDelete] - Additional files to delete during uninstall
; ============================================================================
[UninstallDelete]
; Example: Delete log files created by the app
; Type: files; Name: "{app}\*.log"
; Type: filesandordirs; Name: "{app}\Cache"
; ============================================================================
; [Code] - Pascal scripting section
; ============================================================================
[Code]
// ============================================================================
// CONSTANTS
// ============================================================================
const
// TODO: Add your constants here
APP_NAME = 'My Application';
// ============================================================================
// GLOBAL VARIABLES
// ============================================================================
var
// Custom wizard pages (if needed)
CustomPage: TWizardPage;
// Progress page for long operations
ProgressPage: TOutputProgressWizardPage;
// ============================================================================
// UTILITY FUNCTIONS
// ============================================================================
// Execute a command and capture output
function ExecWithOutput(const Cmd, Params: String; var Output: String): Integer;
var
TempFile: String;
ResultCode: Integer;
OutputAnsi: AnsiString;
begin
TempFile := ExpandConstant('{tmp}\exec_output.txt');
Exec('cmd.exe', '/c ' + Cmd + ' ' + Params + ' > "' + TempFile + '" 2>&1',
'', SW_HIDE, ewWaitUntilTerminated, ResultCode);
if FileExists(TempFile) then
begin
LoadStringFromFile(TempFile, OutputAnsi);
Output := String(OutputAnsi);
DeleteFile(TempFile);
end
else
Output := '';
Result := ResultCode;
end;
// Execute a PowerShell script and capture output
function ExecPowerShell(const Script: String; var Output: String): Integer;
var
TempScript, TempOutput: String;
ResultCode: Integer;
OutputAnsi: AnsiString;
begin
TempScript := ExpandConstant('{tmp}\ps_script.ps1');
TempOutput := ExpandConstant('{tmp}\ps_output.txt');
SaveStringToFile(TempScript, Script, False);
Exec('cmd.exe',
'/c powershell.exe -NoProfile -ExecutionPolicy Bypass -File "' + TempScript + '" > "' + TempOutput + '" 2>&1',
'', SW_HIDE, ewWaitUntilTerminated, ResultCode);
if FileExists(TempOutput) then
begin
LoadStringFromFile(TempOutput, OutputAnsi);
Output := String(OutputAnsi);
DeleteFile(TempOutput);
end
else
Output := '';
DeleteFile(TempScript);
Result := ResultCode;
end;
// Check if a program is installed (by checking registry)
function IsProgramInstalled(const DisplayName: String): Boolean;
var
Subkey: String;
Value: String;
begin
Result := False;
// Check 64-bit registry
Subkey := 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + DisplayName;
if RegQueryStringValue(HKLM, Subkey, 'DisplayName', Value) then
Result := True
else
begin
// Check 32-bit registry on 64-bit Windows
Subkey := 'SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\' + DisplayName;
if RegQueryStringValue(HKLM, Subkey, 'DisplayName', Value) then
Result := True;
end;
end;
// Check if .NET Framework 4.8 is installed
function IsDotNet48Installed: Boolean;
var
Release: Cardinal;
begin
Result := False;
if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', Release) then
Result := (Release >= 528040); // 4.8 or later
end;
// Check if VC++ Redistributable is installed (2015-2022)
function IsVCRedistInstalled: Boolean;
var
Installed: Cardinal;
begin
Result := False;
if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Installed', Installed) then
Result := (Installed = 1);
end;
// Show a modal message dialog with scrollable text
procedure ShowResultsDialog(const Title, Content: String);
var
ResultForm: TSetupForm;
Memo: TNewMemo;
OKButton: TNewButton;
begin
ResultForm := CreateCustomForm;
ResultForm.Caption := Title;
ResultForm.ClientWidth := 500;
ResultForm.ClientHeight := 400;
ResultForm.Position := poScreenCenter;
Memo := TNewMemo.Create(ResultForm);
Memo.Parent := ResultForm;
Memo.Left := 10;
Memo.Top := 10;
Memo.Width := ResultForm.ClientWidth - 20;
Memo.Height := ResultForm.ClientHeight - 60;
Memo.ScrollBars := ssVertical;
Memo.ReadOnly := True;
Memo.Text := Content;
Memo.Font.Name := 'Consolas';
Memo.Font.Size := 9;
OKButton := TNewButton.Create(ResultForm);
OKButton.Parent := ResultForm;
OKButton.Caption := 'OK';
OKButton.Width := 80;
OKButton.Height := 30;
OKButton.Left := (ResultForm.ClientWidth - OKButton.Width) div 2;
OKButton.Top := ResultForm.ClientHeight - 45;
OKButton.ModalResult := mrOK;
OKButton.Default := True;
ResultForm.ShowModal;
ResultForm.Free;
end;
// ============================================================================
// WIZARD PAGE CREATION
// ============================================================================
procedure InitializeWizard;
begin
// Create a progress page for long operations
ProgressPage := CreateOutputProgressPage('Please Wait',
'Please wait while the operation completes...');
// TODO: Create custom wizard pages here if needed
// Example: Create a custom input page
// CustomPage := CreateCustomPage(wpSelectDir, 'Custom Options', 'Configure additional options');
// Example: Add controls to custom page
// var MyLabel: TLabel;
// MyLabel := TLabel.Create(CustomPage);
// MyLabel.Parent := CustomPage.Surface;
// MyLabel.Caption := 'Enter your setting:';
// MyLabel.Left := 0;
// MyLabel.Top := 0;
end;
// ============================================================================
// INSTALLATION EVENTS
// ============================================================================
// Called at the very start - return False to abort
function InitializeSetup: Boolean;
begin
Result := True;
// Example: Check for admin rights
if not IsAdmin then
begin
MsgBox('This installer requires administrator privileges.' + #13#10 +
'Please right-click and select "Run as administrator".',
mbError, MB_OK);
Result := False;
Exit;
end;
// Example: Check prerequisites
// if not IsDotNet48Installed then
// begin
// MsgBox('.NET Framework 4.8 is required but not installed.', mbError, MB_OK);
// Result := False;
// Exit;
// end;
end;
// Called before each wizard page - return True to skip the page
function ShouldSkipPage(PageID: Integer): Boolean;
begin
Result := False;
// Example: Skip directory page for portable install
// if PageID = wpSelectDir then
// Result := True;
end;
// Called when Next button is clicked - return False to stay on page
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
// Example: Validate custom page input
// if CurPageID = CustomPage.ID then
// begin
// if MyEdit.Text = '' then
// begin
// MsgBox('Please enter a value.', mbError, MB_OK);
// Result := False;
// end;
// end;
end;
// Called at each installation step
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: Integer;
begin
// ssInstall: Before files are installed
// ssPostInstall: After files are installed
// ssDone: Installation complete
if CurStep = ssPostInstall then
begin
// Example: Run post-install configuration
// Exec(ExpandConstant('{app}\configure.exe'), '/silent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
end;
// Called at each uninstallation step
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
// usAppMutexCheck: Check for running app
// usUninstall: Before uninstall
// usPostUninstall: After uninstall
// usDone: Uninstall complete
if CurUninstallStep = usUninstall then
begin
// Example: Backup user data before uninstall
end;
end;
// ============================================================================
// SILENT INSTALL SUPPORT
// ============================================================================
// To run silently: MySetup.exe /VERYSILENT /SUPPRESSMSGBOXES
// To run silently with log: MySetup.exe /VERYSILENT /LOG="install.log"
// Check if running in silent mode
function IsSilentMode: Boolean;
begin
Result := WizardSilent;
end;
// Show message only if not in silent mode
procedure ShowMessageIfNotSilent(const Msg: String; MsgType: TMsgBoxType);
begin
if not WizardSilent then
MsgBox(Msg, MsgType, MB_OK);
end;

BIN
Template/banner-sm.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
Template/banner.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

BIN
Template/gea-logo.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB