简体   繁体   English

将文件(依赖项)安装到 Inno Setup 中安装文件夹的子文件夹(lib)中

[英]Install files (dependencies) into subfolder (lib) of the installation folder in Inno Setup

Used Inno Setup to compile an installer with an executable I used from cx_freeze .使用Inno Setup来编译带有我从cx_freeze使用的可执行文件的安装程序。 My executable runs properly when I run it and I am absolutely positive I added all necessary dependencies from the executable file when setting up my installer using Inno Setup Wizard .当我运行它时,我的可执行文件可以正常运行,我绝对肯定我在使用Inno Setup Wizard设置我的安装程序时从可执行文件中添加了所有必要的依赖项。 Yet, I keep getting the following issue when I run my installed executable:然而,当我运行我安装的可执行文件时,我不断收到以下问题: 在此处输入图像描述

The following is the code to my Inno Setup Compiler :以下是我的Inno Setup Compiler的代码:

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Facile"
#define MyAppVersion "0.0.3"
#define MyAppPublisher "Facade Technologies, Inc."
#define MyAppURL "https://facade-technologies.com/"
#define MyAppExeName "facile.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{EAD17C54-8D79-446B-BF80-FFC1F4BC32BF}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputDir=C:\Users\kirim
OutputBaseFilename=mysetup
SetupIconFile=C:\Users\kirim\Documents\Facade Technologies\facile\resources\facade_logo_256.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "armenian"; MessagesFile: "compiler:Languages\Armenian.isl"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"

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

[Files]
Source: "C:\Users\kirim\Documents\Facade Technologies\facile\build\exe.win32-3.7\facile.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\kirim\Documents\Facade Technologies\facile\build\exe.win32-3.7\api-ms-win-crt-heap-l1-1-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\kirim\Documents\Facade Technologies\facile\build\exe.win32-3.7\api-ms-win-crt-locale-l1-1-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\kirim\Documents\Facade Technologies\facile\build\exe.win32-3.7\api-ms-win-crt-math-l1-1-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\kirim\Documents\Facade Technologies\facile\build\exe.win32-3.7\api-ms-win-crt-runtime-l1-1-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\kirim\Documents\Facade Technologies\facile\build\exe.win32-3.7\api-ms-win-crt-stdio-l1-1-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\kirim\Documents\Facade Technologies\facile\build\exe.win32-3.7\facile.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\kirim\Documents\Facade Technologies\facile\build\exe.win32-3.7\python37.dll"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

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

I've read similar post that hint something about the path not being specified for my installer or python not being able to find those modules.我读过类似的帖子,提示我的安装程序没有指定路径或 python 无法找到这些模块。 However, I do not know what to write and wear to write it.但是,我不知道该写什么,穿什么来写它。 Like, would it be something I need to fix in my setup.py script for my executable or something I can fix in my Inno Setup Compiler script?比如,是我需要在我的setup.py脚本中为我的可执行文件修复的东西,还是我可以在我的Inno Setup Compiler脚本中修复的东西? Even more important, what do I need to change or write to get it running properly?更重要的是,我需要更改或编写什么才能使其正常运行? Maybe, could it possibly be because of where I decided to save my.exe that is installed with mysetup.exe ?也许,可能是因为我决定保存与 mysetup.exe 一起安装的my.exe吗? Anything helps, thank you!有什么帮助,谢谢!

Update更新

I think I may have figured out my issue.我想我可能已经弄清楚了我的问题。 Before, I wasn't installing the folders from my.exe folder that contained all the dependencies, I was adding them as files and not folders.以前,我没有从包含所有依赖项的 my.exe 文件夹中安装文件夹,而是将它们添加为文件而不是文件夹。 Now I am adding those folders as folders, but there's still an issue because I am not installing the folders properly.现在我将这些文件夹添加为文件夹,但仍然存在问题,因为我没有正确安装文件夹。 I need to maintain the same file structure in my installed.exe folder as the.exe folder I built on my computer.我需要在我的 installed.exe 文件夹中保持与我在计算机上构建的 .exe 文件夹相同的文件结构。 Here is an example line of code to add a folder to my installed.exe folder in my script:这是在我的脚本中将文件夹添加到我的 installed.exe 文件夹的示例代码行:

Source: "C:\Users\kirim\Documents\Facade Technologies\facile\build\exe.win32-3.7\lib\*"; \
    DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

The issue is that it installs all the folders and files contained within that folder but not the folder itself, so I can keep the same file structure(for example my script isn't install lib folder it's install everything contained in the folder which changes the file structure set for the exe's source code).问题是它安装了该文件夹中包含的所有文件夹和文件,但不安装文件夹本身,因此我可以保持相同的文件结构(例如,我的脚本不是安装lib文件夹,而是安装文件夹中包含的所有内容,这会更改为 exe 的源代码设置的文件结构)。

If you want to install files into subfolder of the installation folder, you have to specify the folder in the DestDir parameter:如果要将文件安装到安装文件夹的子文件夹中,则必须在DestDir参数中指定文件夹:

[Files]
Source: "C:\...\facile\build\exe.win32-3.7\facile.exe"; DestDir: "{app}"; \
    Flags: ignoreversion
Source: "C:\...\facile\build\exe.win32-3.7\lib\*"; DestDir: "{app}\lib"; \
    Flags: ignoreversion recursesubdirs createallsubdirs

Or, if the build folder contains only the files you want to distribute, include it whole:或者,如果 build 文件夹仅包含您要分发的文件,请将其全部包含在内:

[Files]
Source: "C:\...\facile\build\exe.win32-3.7\*"; DestDir: "{app}"; \
    Flags: ignoreversion recursesubdirs createallsubdirs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM