Inno Setup Serial Number Check
Increment Serial Number using EXIF windows,powershell,command-line,exif,exiftool I am using ExifTool to change the camera body serial number to be a unique serial number for each image in a group of images numbering several hundred. The camera body serial number is being used as a second place, in addition to where the serial number for the. Caption:= 'Enter valid serial number and continue the installation.' ; DescLabel.Font.Style:= [fsBold]; SetArrayLength(SerialEdits, SC_EDITCOUNT); EditWidth:= (SerialPage.SurfaceWidth - ((SC_EDITCOUNT - 1) * 8)) div SC_EDITCOUNT; for I:= 0 to SC_EDITCOUNT - 1 do begin Edit:= TEdit.Create(SerialPage); Edit. + Lexpa - Inno Setup integration for Visual Studio [Creates small and fast installers. + Votive - WiX. Most likely Microsoft though it would be best if the serial number validation was performed by the application instead of the installer. There is also the validation process which differs.
Inno Setup Extractor
#define DotNetRuntimeExe 'NDP461-KB3102436-x86-x64-AllOS-ENU.exe' |
[CustomMessages] |
InstallingDotNetFramework=Installing .NET Framework. This might take a few minutes... |
DotNetFrameworkFailedToLaunch=Failed to launch .NET Framework Installer with error '%1'. Please fix the error then run this installer again. |
DotNetFrameworkFailed1602=.NET Framework installation was cancelled. This installation can continue, but be aware that this application may not run unless the .NET Framework installation is completed successfully. |
DotNetFrameworkFailed1603=A fatal error occurred while installing the .NET Framework. Please fix the error, then run the installer again. |
DotNetFrameworkFailed5100=Your computer does not meet the requirements of the .NET Framework. Please consult the documentation. |
DotNetFrameworkFailedOther=The .NET Framework installer exited with an unexpected status code '%1'. Please review any other messages shown by the installer to determine whether the installation completed successfully, and abort this installation and fix the problem if it did not. |
[Files] |
Source: '{#DotNetRuntimeExe}'; DestDir: '{tmp}'; Flags: dontcopy nocompression noencryption |
[Code] |
var |
requiresRestart: boolean; |
// Detect .NET framework 4.6.1 is missing |
// See https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx |
function DotNetIsMissing(): Boolean; |
var |
readVal: cardinal; |
success: Boolean; |
begin |
success := RegQueryDWordValue(HKLM, 'SOFTWAREMicrosoftNET Framework SetupNDPv4Full', 'Release', readVal); |
success := success and ((readVal = 394254) or (readVal = 394271)); |
Result := not success; |
end; |
// Adapted from https://blogs.msdn.microsoft.com/davidrickard/2015/07/17/installing-net-framework-4-5-automatically-with-inno-setup/ |
function InstallDotNet(): String; |
var |
statusText: string; |
resultCode: Integer; |
begin |
statusText := WizardForm.StatusLabel.Caption; |
WizardForm.StatusLabel.Caption := CustomMessage('InstallingDotNetFramework'); |
WizardForm.ProgressGauge.Style := npbstMarquee; |
try |
ExtractTemporaryFile('{#DotNetRuntimeExe}'); |
if not Exec(ExpandConstant('{tmp}{#DotNetRuntimeExe}'), '/passive /norestart /showrmui /showfinalerror', ', SW_SHOW, ewWaitUntilTerminated, resultCode) then |
begin |
Result := FmtMessage(CustomMessage('DotNetFrameworkFailedToLaunch'), [SysErrorMessage(resultCode)]); |
end |
else |
begin |
// See https://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx#return_codes |
case resultCode of |
0: begin |
// Successful |
end; |
1602 : begin |
MsgBox(CustomMessage('DotNetFrameworkFailed1602'), mbInformation, MB_OK); |
end; |
1603: begin |
Result := CustomMessage('DotNetFrameworkFailed1603'); |
end; |
1641: begin |
requiresRestart := True; |
end; |
3010: begin |
requiresRestart := True; |
end; |
5100: begin |
Result := CustomMessage('DotNetFrameworkFailed5100'); |
end; |
else begin |
MsgBox(FmtMessage(CustomMessage('DotNetFrameworkFailedOther'), [IntToStr(resultCode)]), mbError, MB_OK); |
end; |
end; |
end; |
finally |
WizardForm.StatusLabel.Caption := statusText; |
WizardForm.ProgressGauge.Style := npbstNormal; |
end; |
end; |
function PrepareToInstall(var NeedsRestart: Boolean): String; |
begin |
// 'NeedsRestart' only has an effect if we return a non-empty string, thus aborting the installation. |
// If the installers indicate that they want a restart, this should be done at the end of installation. |
// Therefore we set the global 'restartRequired' if a restart is needed, and return this from NeedRestart() |
if DotNetIsMissing() then |
begin |
Result := InstallDotNet(); |
end; |
end; |
function NeedRestart(): Boolean; |
begin |
Result := requiresRestart; |
end |
commented Apr 11, 2018
Inno Setup Tutorial
ok |