The project of Inno Setup for Windows 64-bit

1.1k views Asked by At

I had created the project via Inno Setup for Windows 64-bit (e.g. Win 7 / 8). After Installed I have detected that the files of the handbook can not open! Code of my project the Inno Setup below.

How can I solve it problem? Where my error in it the project?

#define MyAppName "MyProgram"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "Publish Inc."
#define MyAppURL "http://www.mydomen.com/"
#define MyAppExeName "myprogram.exe"

[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=C:\Users\path_to_my_program\Win64\Debug\license-ru.txt
InfoAfterFile=C:\Users\path_to_my_program\Win64\Debug\readme-ru.txt
OutputDir=C:\Users\Documents\Inno Setup\Setups
OutputBaseFilename=myprogramsetup64
SetupIconFile=C:\Users\path_to_my_program\myprogram_Icon.ico
Compression=lzma2
SolidCompression=yes
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "    {cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "C:\Users\path_to_my_program\Win64\Debug\myprogram.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\path_to_my_program\Win64\Debug\SQLite3.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\path_to_my_program\Win64\Debug\help\handbook-ru.pdf"; DestDir: "{app}\help"; Flags: ignoreversion
Source: "C:\Users\path_to_my_program\Win64\Debug\help\handbook-en.pdf"; DestDir: "{app}\help"; Flags: ignoreversion

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,   {#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

After Installed I can not to open from my program the help files - handbook-ru.pdf and handbook-en.pdf. It is problem.

I had in my program used code:

procedure TForm1.MenuItem1Click(Sender: TObject);
var
  path_to_handbook : WideString;
begin
  case language of
    $0019 : path_to_handbook := 'help\handbook-ru.pdf'; // Russian
    $0009 : path_to_handbook := 'help\handbook-en.pdf'; // English
  end;

  ShellExecuteW(Handle, nil, PWideChar(path_to_handbook), nil,  nil, SW_SHOWNORMAL);
end;

In debug and runtime the help files had been to open excellent!

And still...

The program is normally installed only with the rights of the administrator.

If Installed with the administrator right then the help files not open and the my program - working well. If Installed without the administrator right then the help files open well but the my program - working with errors.

Any ideas how to correct a code in Inno Setup.

Thank you very much.

0

There are 0 answers