问题
Is it possible to create the Inno Setup script to copy files from a UNC path on the network rather than statically adding them to the setup file?
If so, can it still be done if I need to authenticate to the path first? Is there a mechanism to provide authentication info in the Inno Setup script?
Essentially, I am wanting setup to just copy files from various sources over the intranet from a UNC path to put into the setup destination directory.
回答1:
Yes, specify the UNC path in the Source
parameter of the [Files] section entry and use the external flag.
[Files]
Source: \\UNC\path\file.txt; DestDir: {app}; Flags: external
To authenticate, you would have to call the WNetUseConnection or similar WinAPI.
See How to execute "net use" command from Inno Setup installer on Windows 7?
来源:https://stackoverflow.com/questions/42565324/can-i-create-installer-that-copies-files-from-a-unc-path-on-the-network