Inno Setup - Get a path to parent folder

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 02:10:02

问题


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.


回答1:


Use the ExtractFilePath function:

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.



来源:https://stackoverflow.com/questions/35966417/inno-setup-get-a-path-to-parent-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!