这条语句直接获取安装包文件名 String.SplitPath(SessionVar.Expand("%SourceFilename%")).Filename
下边分开来讲一下:
%SourceFilename% 是安装包完整路径变量。
SessionVar.Expand("%SourceFilename%") 用于获取安装包完整路径包括文件名。
String.SplitPath 拆分路径返回值是个table,table成员如下:
|
KEY |
TYPE |
DESCRIPTION |
|
Drive |
string |
The drive portion of the path (for example, C:). |
|
Folder |
string |
All of the folders within the path (for example, \MyFolder1\MyFolder2\). |
|
Filename |
string |
The filename in the path (for example, "myfile"). |
|
Extension |
string |
The file extension in the path (for example, ".exe"). |
Dirve : 磁盘盘符,例如 "C:"
Folder:所在文件夹,例如 "C:\Windows"
Filename:文件名, 例如"setup"
Extension:扩展名,例如".exe"
本文详细解析了从安装包完整路径中提取文件名的步骤,通过使用变量、函数和路径处理方法,实现从指定变量中获取并拆分安装包路径与文件名。

被折叠的 条评论
为什么被折叠?



