Inno Setup-获取父文件夹的路径 [英] Inno Setup - Get a path to parent folder

查看:268
本文介绍了Inno Setup-获取父文件夹的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要获取{app}的父文件夹.如果最终用户不更改默认值,这是标准做法,但是如果他更改了默认值,则问题变得更加棘手.基本上,我需要一个函数,该函数将输出所有内容,直到最后一个\反斜杠(包括反斜杠).想要尝试Pos,但它仅检测字符的第一个实例.

I need to get the parent folder of {app}. It's standard if the end user didn't change the default, but if he did, it becomes a little more problematic. Basically, I need a function, that will output everything till the last \ backslash (inclusive). Wanted to try Pos, but it only detects the first instance of the character.

推荐答案

使用 ExtractFilePath函数:

提取给定文件名的驱动器和目录部分.生成的字符串是FileName的最左字符,直到并包括冒号或反斜杠,以将路径信息与名称和扩展名分开.如果FileName不包含驱动器和目录部分,则结果字符串为空.

Extracts the drive and directory parts of the given file name. The resulting string is the leftmost characters of FileName, up to and including the colon or backslash that separates the path information from the name and extension. The resulting string is empty if FileName contains no drive and directory parts.

这篇关于Inno Setup-获取父文件夹的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆