Замените функцию и пробуйте
Спасибо, работает.
Код: Выделить всё
procedure UpdateInfo();
var
DeviceName, DeviceKey: String;
begin
ChangeText := False
GetWindowsVersionEx(Version)
// Операционная система:
SystemVersionPanel.Color := clBlack
SystemVersionPanel.Font.Color := clGreen
DeviceKey := 'Software\Microsoft\Windows NT\CurrentVersion'
if not UsingWinNT then StringChange(DeviceKey, 'Windows NT', 'Windows')
RegQueryStringValue(HKLM, DeviceKey, 'ProductName', DeviceName)
if RegQueryStringValue(HKLM, DeviceKey, 'CSDVersion', DeviceKey) then
DeviceName := DeviceName + ' ' + DeviceKey
StringChange(DeviceName, 'Microsoft ', '')
SystemVersionPanel.Text := ' ' + DeviceName + ' сборка ' + IntToStr(Version.Major) + '.' + IntToStr(Version.Minor) +
'.' + IntToStr(Version.Build)
if (Pos('Windows 10', SystemVersionPanel.Text) = 0) and // Windows 10
(Pos('Windows 7', SystemVersionPanel.Text) = 0) then // Windows 7
begin
SystemVersionPanel.Color := clBlack
SystemVersionPanel.Font.Color := clRed
ChangeText := True
end
...
...
...Код: Выделить всё
{sd}\Users\{username}\Saved Games
Код: Выделить всё
[Code]
if RegValueExists(HKEY_CURRENT_USER, 'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', '{4C5C32FF-BB9D-43B0-B5B4-2D72E54EAAA4}') then
begin
// The value exists
end;
end;
Код: Выделить всё
{reg:HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders,%7B{4C5C32FF-BB9D-43B0-B5B4-2D72E54EAAA4}}
Код: Выделить всё
;InnoSetupVersion=5.6.1 (Unicode)
#pragma include __INCLUDE__ + ";" + ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir")
#define MyApp "My Super-Puper Programm"
#define ShortName "MSPP"
#define Version "3.4.2"
#define Publisher "by SuperUser"
#define Team "Super Team"
#define URL "viewtopic.php?p=2774500#p2774500"
#define UpdatesURL "https://github.com/SuperUser/SuperTeam/blob/master/update.exe"
#define ExeName "MSPP"
#define Skin "CrystalBlue"
[Setup]
AppId={{E4F0B51A-4567-4C49-AD5D-D9A8B6BBBCF3F}
AppName={#ShortName}
AppVersion={#Version}
AppVerName={#MyApp} v{#Version}
AppPublisher={#MyApp} {#Team}
AppPublisherURL={#URL}
AppSupportURL={#URL}
AppUpdatesURL={#UpdatesURL}
DefaultDirName={sd}\{#ShortName}
DefaultGroupName={#ShortName}
ShowLanguageDialog=no
UninstallDisplayIcon={app}\MSPP.exe
UninstallDisplayName={#ShortName}
AllowNoIcons=yes
OutputDir=.
OutputBaseFilename=setup
SetupIconFile=embedded\myicon.ico
WizardImageFile=embedded\WizardImage.bmp
WizardSmallImageFile=embedded\WizardSmallImage.bmp
WizardImageAlphaFormat=premultiplied
VersionInfoCompany={#Team}
VersionInfoCopyright={#ShortName} {#Publisher}
VersionInfoDescription={#MyApp} {#Publisher}
VersionInfoVersion={#Version}
Compression=lzma2/max
SolidCompression=Yes
#include
#include
#include
[Files]
Source: "embedded\ISSkin\ISSkinU.dll"; DestDir: {tmp}; Flags: dontcopy
Source: "embedded\ISSkin\Styles\{#Skin}.cjstyles"; DestDir: {tmp}; Flags: dontcopy
Source: "embedded\7z.dll"; DestDir: {tmp}; Flags: dontcopy
Source: "embedded\7z.exe"; DestDir: {tmp}; Flags: dontcopy
Source: "embedded\7z32.dll"; DestDir: {tmp}; Flags: dontcopy
Source: "embedded\7z32.exe"; DestDir: {tmp}; Flags: dontcopy
Source: "{app}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "embedded\EN\config.ini"; DestDir: "{app}"; Languages: en; Flags: ignoreversion
Source: "embedded\RU\config.ini"; DestDir: "{app}"; Languages: ru; Flags: ignoreversion
Source: "embedded\DE\config.ini"; DestDir: "{app}"; Languages: de; Flags: ignoreversion
[Languages]
Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl"; InfoBeforeFile: "embedded\InfoBefore-ru.rtf"
Name: "en"; MessagesFile: "compiler:Default.isl"; InfoBeforeFile: "embedded\InfoBefore-en.rtf"
Name: "de"; MessagesFile: "compiler:Languages\German.isl"; InfoBeforeFile: "embedded\InfoBefore-de.rtf"
[CustomMessages]
ru.CautionXP64=Для работы программы требуется PowerShell 5.1.%nНа Windows XP 64bit программа не сможет скачивать обновления для конвертации игр и выполнять некоторые другие функции.
ru.CautionVI64=Для работы программы требуется PowerShell 5.1.%nНа Windows Vista 64bit программа не сможет скачивать обновления для конвертации игр и выполнять некоторые другие функции.
ru.Caution7064=На компьютере обнаружена устаревшая версия PowerShell.%nПосле установки программы будет произведено скачивание и установка обновления PowerShell 5.1 для Windows 7 64bit.%n%nПожалуйста, дождитесь завершения обновления!
ru.Caution8064=На компьютере обнаружена устаревшая версия PowerShell.%nПосле установки программы будет произведено скачивание и установка обновления PowerShell 5.1 для Windows 8.0 64bit.%n%nПожалуйста, дождитесь завершения обновления!
ru.Caution8164=На компьютере обнаружена устаревшая версия PowerShell.%nПосле установки программы будет произведено скачивание и установка обновления PowerShell 5.1 для Windows 8.1 64bit.%n%nПожалуйста, дождитесь завершения обновления!
ru.CautionXP32=Для работы программы требуется PowerShell 5.1.%nНа Windows XP 32bit программа не сможет скачивать обновления для конвертации игр и выполнять некоторые другие функции.
ru.CautionVI32=Для работы программы требуется PowerShell 5.1.%nНа Windows Vista 32bit программа не сможет скачивать обновления для конвертации игр и выполнять некоторые другие функции.
ru.Caution7032=На компьютере обнаружена устаревшая версия PowerShell.%nПосле установки программы будет произведено скачивание и установка обновления PowerShell 5.1 для Windows 7 32bit.%n%nПожалуйста, дождитесь завершения обновления!
ru.Caution8132=На компьютере обнаружена устаревшая версия PowerShell.%nПосле установки программы будет произведено скачивание и установка обновления PowerShell 5.1 для Windows 8.1 32bit.%n%nПожалуйста, дождитесь завершения обновления!
en.CautionXP64=The program requires PowerShell 5.1.%nOn Windows XP 64bit, the program will not be able to download updates for converting games and perform some other functions.
en.CautionVI64=The program requires PowerShell 5.1.%nOn Windows Vista 64bit, the program will not be able to download updates for converting games and perform some other functions.
en.Caution7064=An outdated version of PowerShell has been detected on your computer.%nAfter installing the program, the PowerShell 5.1 update for Windows 7 64bit will be downloaded and installed.%n%nPlease wait until the update is complete!
en.Caution8064=An outdated version of PowerShell has been detected on your computer.%nAfter installing the program, the PowerShell 5.1 update for Windows 8.0 64bit will be downloaded and installed.%n%nPlease wait until the update is complete!
en.Caution8164=An outdated version of PowerShell has been detected on your computer.%nAfter installing the program, the PowerShell 5.1 update for Windows 8.1 64bit will be downloaded and installed.%n%nPlease wait until the update is complete!
en.CautionXP32=The program requires PowerShell 5.1.%nOn Windows XP 32bit, the program will not be able to download updates for converting games and perform some other functions.
en.CautionVI32=The program requires PowerShell 5.1.%nOn Windows Vista 32bit, the program will not be able to download updates for converting games and perform some other functions.
en.Caution7032=An outdated version of PowerShell has been detected on your computer.%nAfter installing the program, the PowerShell 5.1 update for Windows 7 32bit will be downloaded and installed.%n%nPlease wait until the update is complete!
en.Caution8132=An outdated version of PowerShell has been detected on your computer.%nAfter installing the program, the PowerShell 5.1 update for Windows 8.1 32bit will be downloaded and installed.%n%nPlease wait until the update is complete!
de.CautionXP64=Das Programm erfordert PowerShell 5.1.%nUnter Windows XP 64bit kann das Programm keine Updates zum Konvertieren von Spielen herunterladen und einige andere Funktionen ausführen.
de.CautionVI64=Das Programm erfordert PowerShell 5.1.%nUnter Windows Vista 64bit kann das Programm keine Updates zum Konvertieren von Spielen herunterladen und einige andere Funktionen ausführen.
de.Caution7064=Auf Ihrem Computer wurde eine veraltete Version von PowerShell erkannt.%nNach der Installation des Programms wird das PowerShell 5.1-Update für Windows 7 64bit heruntergeladen und installiert.%n%nBitte warten Sie bis das Update abgeschlossen ist!
de.Caution8064=Auf Ihrem Computer wurde eine veraltete Version von PowerShell erkannt.%nNach der Installation des Programms wird das PowerShell 5.1-Update für Windows 8.0 64bit heruntergeladen und installiert.%n%nBitte warten Sie bis das Update abgeschlossen ist!
de.Caution8164=Auf Ihrem Computer wurde eine veraltete Version von PowerShell erkannt.%nNach der Installation des Programms wird das PowerShell 5.1-Update für Windows 8.1 64bit heruntergeladen und installiert.%n%nBitte warten Sie bis das Update abgeschlossen ist!
de.CautionXP32=Das Programm erfordert PowerShell 5.1.%nUnter Windows XP 32bit kann das Programm keine Updates zum Konvertieren von Spielen herunterladen und einige andere Funktionen ausführen.
de.CautionVI32=Das Programm erfordert PowerShell 5.1.%nUnter Windows Vista 32bit kann das Programm keine Updates zum Konvertieren von Spielen herunterladen und einige andere Funktionen ausführen.
de.Caution7032=Auf Ihrem Computer wurde eine veraltete Version von PowerShell erkannt.%nNach der Installation des Programms wird das PowerShell 5.1-Update für Windows 7 32bit heruntergeladen und installiert.%n%nBitte warten Sie bis das Update abgeschlossen ist!
de.Caution8132=Auf Ihrem Computer wurde eine veraltete Version von PowerShell erkannt.%nNach der Installation des Programms wird das PowerShell 5.1-Update für Windows 8.1 32bit heruntergeladen und installiert.%n%nBitte warten Sie bis das Update abgeschlossen ist!
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"
[Icons]
Name: "{group}\{#ShortName}"; Filename: "{app}\{#ExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#ShortName}}"; Filename: "{#URL}"
Name: "{group}\{cm:UninstallProgram,{#ShortName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#ShortName}"; Filename: "{app}\{#ExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#ShortName}"; Filename: "{app}\{#ExeName}"; Tasks: quicklaunchicon
[Run]
Filename: "{app}\{#ExeName}"; Description: "{cm:LaunchProgram,{#StringChange(ShortName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[_Code]
procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:ISSkinU.dll stdcall';
procedure UnloadSkin(); external 'UnloadSkin@files:ISSkinU.dll stdcall';
function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall';
function IsWindowsVersionOrNewer(Major, Minor: Integer): Boolean;
var
Version: TWindowsVersion;
begin
GetWindowsVersionEx(Version);
Result := (Version.Major > Major) or ((Version.Major = Major) and (Version.Minor >= Minor));
end;
function IsWindowsXPOrNewer: Boolean; begin Result := IsWindowsVersionOrNewer(5, 1); end;
function IsWindowsViOrNewer: Boolean; begin Result := IsWindowsVersionOrNewer(6, 0); end;
function IsWindows70OrNewer: Boolean; begin Result := IsWindowsVersionOrNewer(6, 1); end;
function IsWindows80OrNewer: Boolean; begin Result := IsWindowsVersionOrNewer(6, 2); end;
function IsWindows81OrNewer: Boolean; begin Result := IsWindowsVersionOrNewer(6, 3); end;
function IsWindows10OrNewer: Boolean; begin Result := IsWindowsVersionOrNewer(10,0); end;
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('{#Skin}.cjstyles');
LoadSkin(ExpandConstant('{tmp}\{#Skin}.cjstyles'), '');
Result := True;
end;
// Скачиваем PowerShell 5.1 под нашу версию Windows и битность...
procedure InitializeWizard;
var
PSVersion: String;
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine','PowerShellVersion', PSVersion);
if Copy(PSVersion,1,3) < '5.1' then
begin
if IsWin64 then
begin
if IsWindowsXPOrNewer and not IsWindowsViOrNewer then begin MsgBox(ExpandConstant('{cm:CautionXP64}'),mbCriticalError, MB_OK); end else
if IsWindowsViOrNewer and not IsWindows70OrNewer then begin MsgBox(ExpandConstant('{cm:CautionVI64}'),mbCriticalError, MB_OK); end else
if IsWindows70OrNewer and not IsWindows80OrNewer then begin MsgBox(ExpandConstant('{cm:Caution7064}'), mbInformation, MB_OK);
idpAddFileSize('https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win7AndW2K8R2-KB3191566-x64.zip',ExpandConstant('{tmp}\Win7AndW2K8R2-KB3191566-x64.zip'),68076477); end else
if IsWindows80OrNewer and not IsWindows81OrNewer then begin MsgBox(ExpandConstant('{cm:Caution8064}'), mbInformation, MB_OK);
idpAddFileSize('https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/W2K12-KB3191565-x64.msu',ExpandConstant('{tmp}\W2K12-KB3191565-x64.msu'),21585220); end else
if IsWindows81OrNewer and not IsWindows10OrNewer then begin MsgBox(ExpandConstant('{cm:Caution8164}'), mbInformation, MB_OK);
idpAddFileSize('https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win8.1AndW2K12R2-KB3191564-x64.msu',ExpandConstant('{tmp}\Win8.1AndW2K12R2-KB3191564-x64.msu'),19878906); end;
end
else
begin
if IsWindowsXPOrNewer and not IsWindowsViOrNewer then begin MsgBox(ExpandConstant('{cm:CautionXP32}'),mbCriticalError, MB_OK); end else
if IsWindowsViOrNewer and not IsWindows70OrNewer then begin MsgBox(ExpandConstant('{cm:CautionVI32}'),mbCriticalError, MB_OK); end else
if IsWindows70OrNewer and not IsWindows80OrNewer then begin MsgBox(ExpandConstant('{cm:Caution7032}'), mbInformation, MB_OK);
idpAddFileSize('https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win7-KB3191566-x86.zip',ExpandConstant('{tmp}\Win7-KB3191566-x86.zip'),44821734); end else
if IsWindows81OrNewer and not IsWindows10OrNewer then begin MsgBox(ExpandConstant('{cm:Caution8132}'), mbInformation, MB_OK);
idpAddFileSize('https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win8.1-KB3191564-x86.msu',ExpandConstant('{tmp}\Win8.1-KB3191564-x86.msu'),15231117); end;
end;
idpDownloadAfter(wpReady);
end;
end;
// Во время показа страницы загрузки открываем по умолчанию скрытые детали загрузки...
procedure CurPageChanged(CurPageID: Integer);
begin
if Assigned(IDPForm.Page) then
begin
if CurPageID = IDPForm.Page.ID then
begin
// Показать детали загрузки
idpShowDetails(True);
// Скрываем кнопку Подробно/Скрыть
IDPForm.DetailsButton.Visible := False;
end;
end;
end;
// Распаковываем ранее скачанный ZIP/MSU и запускаем установку...
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: Integer;
begin
if CurStep = ssPostInstall then
begin
if IsWin64 then
begin
if FileExists(ExpandConstant('{tmp}\Win7AndW2K8R2-KB3191566-x64.zip')) then
begin
ExtractTemporaryFile('7z.exe');
ExtractTemporaryFile('7z.dll');
ShellExec('open',ExpandConstant('{tmp}\7z.exe'),ExpandConstant('x -y -oExtractedArchive ')+ExpandConstant('Win7AndW2K8R2-KB3191566-x64.zip'),'',SW_HIDE,ewWaitUntilTerminated,ResultCode);
ShellExec('open',ExpandConstant('{sys}\wusa.exe'),ExpandConstant('{tmp}\ExtractedArchive\Win7AndW2K8R2-KB3191566-x64.msu'),'',SW_SHOWNORMAL,ewWaitUntilTerminated,ResultCode);
end;
if FileExists(ExpandConstant('{tmp}\W2K12-KB3191565-x64.msu')) then ShellExec('open',ExpandConstant('{sys}\wusa.exe'),ExpandConstant('{tmp}\W2K12-KB3191565-x64.msu'),'',SW_SHOWNORMAL,ewWaitUntilTerminated,ResultCode);
if FileExists(ExpandConstant('{tmp}\Win8.1AndW2K12R2-KB3191564-x64.msu')) then ShellExec('open',ExpandConstant('{sys}\wusa.exe'),ExpandConstant('{tmp}\Win8.1AndW2K12R2-KB3191564-x64.msu'),'',SW_SHOWNORMAL,ewWaitUntilTerminated,ResultCode);
end
else
begin
if FileExists(ExpandConstant('{tmp}\Win7-KB3191566-x86.zip')) then
begin
ExtractTemporaryFile('7z32.exe');
ExtractTemporaryFile('7z32.dll');
ShellExec('open',ExpandConstant('{tmp}\7z32.exe'),ExpandConstant('x -y -oExtractedArchive ')+ExpandConstant('Win7-KB3191566-x86.zip'),'',SW_HIDE,ewWaitUntilTerminated,ResultCode);
ShellExec('open',ExpandConstant('{sys}\wusa.exe'),ExpandConstant('{tmp}\ExtractedArchive\Win7-KB3191566-x86.msu'),'',SW_SHOWNORMAL,ewWaitUntilTerminated,ResultCode);
end;
if FileExists(ExpandConstant('{tmp}\Win8.1-KB3191564-x86.msu')) then ShellExec('open',ExpandConstant('{sys}\wusa.exe'),ExpandConstant('{tmp}\Win8.1-KB3191564-x86.msu'),'',SW_SHOWNORMAL,ewWaitUntilTerminated,ResultCode);
end;
end;
end;
procedure DeinitializeSetup();
begin
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
UnloadSkin();
end;Код: Выделить всё
procedure UpdateInfo();
var
DeviceName, DeviceKey: String;
begin
ChangeText := False
GetWindowsVersionEx(Version)
// Операционная система:
SystemVersionPanel.Color := clBlack
SystemVersionPanel.Font.Color := clGreen
DeviceKey := 'Software\Microsoft\Windows NT\CurrentVersion'
if not UsingWinNT then StringChange(DeviceKey, 'Windows NT', 'Windows')
RegQueryStringValue(HKLM, DeviceKey, 'ProductName', DeviceName)
if RegQueryStringValue(HKLM, DeviceKey, 'CSDVersion', DeviceKey) then
DeviceName := DeviceName + ' ' + DeviceKey
StringChange(DeviceName, 'Microsoft ', '')
SystemVersionPanel.Text := ' ' + DeviceName + ' сборка ' + IntToStr(Version.Major) + '.' + IntToStr(Version.Minor) +
'.' + IntToStr(Version.Build)
if (Pos('Windows 10', SystemVersionPanel.Text) = 0) and // Windows 10
(Pos('Windows 7', SystemVersionPanel.Text) = 0) then // Windows 7
begin
SystemVersionPanel.Color := clBlack
SystemVersionPanel.Font.Color := clRed
ChangeText := True
end
...
...
...
Выше же я вам дал код определения разрядности системы, просто там в соответствии с разрядностью идёт скачивание PowerShell определённой версии и разрядности, а вам надо было просто подменить тот код на вывод информации на экран, либо воспроизведение каких-либо действий, по вашему желанию.Код: Выделить всё
// До секции CODE прописываем свои текстовые сообщения, чтобы не отнимать место в коде программы в секции CODE:
[CustomMessages]
Info-text-x64=У вас разрядность системы Windows - x64.%nЭто значит, что система 64-битная.%n%nНе переживайте, всё будет хорошо.
Info-text-x86=У вас разрядность системы Windows - x86.%nЭто значит, что система 32-битная.%n%nНе переживайте, всё будет хорошо.
// То, что ниже, пишем в секции CODE:
// Если у вас x64, тогда...
if IsWin64 then
// Выполняем в таком случае код между "begin" и "end" (между стартом и концом):
begin
// Выводим оповещение об разрядности x64 на экран:
MsgBox(ExpandConstant('{cm:Info-text-x64}'), mbInformation, MB_OK);
end
// В противном случае (т.е. если у вас не x64, а значит x86):
else
// Выполняем в таком случае код между "begin" и "end" (между стартом и концом)
begin
// Выводим оповещение об разрядности x86 на экран
MsgBox(ExpandConstant('{cm:Info-text-x86}'), mbInformation, MB_OK);
end;

Код: Выделить всё
procedure InitializeWizard;
var
i,j: integer;
s,abc: string;
begin
j := 0;
abc := '0123456789абв%*@abc';
s:='012';
for i:=1 to Length(s) do
begin
if Pos(s[i],abc) = 0 then
inc(j);
end;
if j >= 1 then
begin
MsgBox('Error! 0123456789абв%*@abc chars only are allowed!', mbInformation, MB_OK);
Exit;
end;
end;