Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Installation Windows 64位系统的Inno安装项目_Installation_Inno Setup_Win64 - Fatal编程技术网

Installation Windows 64位系统的Inno安装项目

Installation Windows 64位系统的Inno安装项目,installation,inno-setup,win64,Installation,Inno Setup,Win64,我已经通过Inno Setup for Windows 64位(例如Win 7/8)创建了该项目。 安装后我检测到手册的文件无法打开! 我的项目代码如下所示 我怎样才能解决这个问题? 我在项目中的错误在哪里 #define MyAppName "MyProgram" #define MyAppVersion "1.0.0" #define MyAppPublisher "Publish Inc." #define MyAppURL "http://www.mydomen.com/" #defin

我已经通过Inno Setup for Windows 64位(例如Win 7/8)创建了该项目。 安装后我检测到手册的文件无法打开! 我的项目代码如下所示

我怎样才能解决这个问题? 我在项目中的错误在哪里

#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
安装后,我无法从程序中打开帮助文件-handbook-ru.pdf和handbook-en.pdf。这是个问题

我在程序中使用了以下代码:

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;
在调试和运行时的帮助文件已被打开优秀

但是

该程序通常仅在具有管理员权限的情况下安装

如果在管理员权限下安装,则“帮助文件”不会打开,“我的程序”运行良好。 如果在没有管理员权限的情况下安装,则帮助文件会很好地打开,但“我的程序”会出错

任何关于如何在Inno设置中更正代码的想法


非常感谢。

“无法打开”是一个模糊的描述。您需要更深入地了解安装后的情况,并发布有关此问题的更多详细信息。
ShellExecute
函数返回值,您应该在Delphi/FreePascal应用程序中检查该值。我猜它会返回
ERROR\u FILE\u NOT\u FOUND
,因为您在那里使用了相对路径(因为您位于不同的工作目录)。我建议您始终使用文件的绝对路径。我使用绝对路径-ExtractFilePath(Application.ExeName)解决了我的问题。管理员权限存在问题。只有具有管理员权限才能正确安装我的程序。我的代码Inno设置中哪里有错误?非常感谢你!我看不出你的Inno安装脚本有任何问题。安装程序必须运行提升版,因为您将要写入“Program Files”文件夹,该文件夹自Windows Vista以来需要管理员权限,因此必须使用管理员权限进行安装。然后使用原始用户权限(非提升)执行应用程序(我指的是在最后一页选中“运行应用程序”复选框时的执行),因此它与您在开始菜单中执行应用程序的情况相同。因此,即使是这也不意味着什么不寻常的事情。您是否检查了返回您的
ShellExecute
函数调用的内容?对不起,我很忙,绝对路径已注册,但问题仍然存在!帮助文件的问题仍然存在,以及管理员权限的安装问题。在codes Inno Setup中,可能需要添加或更改与管理员权限有关的内容?谢谢