我在应用程序加载时让应用程序显示其指定的背景图像.然后它在启动时崩溃运行此代码:
// unzip own resources like images, data files ettc.
FAppDataDirPath := GetHomePath + PathDelim + Application.Title + '.app' + PathDelim;
P := FAppDataDirPath + 'assets.zip';
if FileExists(P) then
begin
Z := TZipFile.Create;
try
Z.Open(P, zmRead);
Z.ExtractAll(FAppDataDirPath + 'Library');
finally
Z.Free;
end;
end
;
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:

问题是您使用了错误的方法来获取位置。
切换到 using System.IOUtils.TPath,使用TPath.GetHomePath获取主文件夹、TPath.GetDocumentsPath文件Documents夹以及TPath.GetLibraryPath获取Library文件夹位置。
| 归档时间: |
|
| 查看次数: |
618 次 |
| 最近记录: |