2017-08-25 94 views
-1

我为我的应用程序创建了inno安装程序安装程序。现在我想将该安装程序放置在用户可以从其安装的共享文件夹中。从共享驱动器运行inno安装程序

安装程序需要将文件放在{%HOMEPATH}\{#MyAppName}目录中。但是,当我设置AllowUNCPath=yes它可以从共享驱动器运行,但它会将文件安装在fileshare\{%HOMEPATH}\{#MyAppName}上。

是否可以从文件共享中运行安装程序并将其安装在用户本地驱动器上?

我的设置部分看起来像:

[Setup]  

    AppId="{{AAAAAA-AAAA-AAAA-AAAA-AAAAAAAA}" 
    AppName={#MyAppName} 
    ;AppVersion={#MyAppVersion} 
    AppVersion={code:getVersionNumber} 
    ;AppVerName={#MyAppName} {#MyAppVersion} 
    AppPublisher={#MyAppPublisher} 
    DefaultDirName={%HOMEPATH}\{#MyAppName} 
    DefaultGroupName={#MyAppPublisher} 
    OutputDir=compiledInstaller 
    OutputBaseFilename=setup 
    SetupIconFile={#iconName} 
    ;Set some installer settings 
    Compression=lzma 
    SolidCompression=yes 
    ArchitecturesAllowed=x64 
    PrivilegesRequired=lowest 
    AllowCancelDuringInstall=False 
    AllowUNCPath=false 
    ArchitecturesInstallIn64BitMode=x64 
    CreateUninstallRegKey=yes 
    UsePreviousAppDir=yes 
    ;Disable different screens 
    DisableDirPage=yes 
    DisableProgramGroupPage=yes 
    DisableReadyPage=True 
    DisableReadyMemo=True 
    DisableFinishedPage=True 
    DisableWelcomePage=True 

    [Files] 
    Source: "{#path}*"; DestDir: "{app}"; Flags: external recursesubdirs 
    Source: "{#path}/.eclipseproduct"; DestDir: "{app}"; Flags: external 
    Source: "{#installerPath}/{#ScriptName}"; DestDir: "{app}"; Flags: external 
    Source: "{#installerPath}/{#iconName}"; DestDir: "{app}"; Flags: external 

pathinstallerPath变量被链接到共享驱动器上的文件。

,我从运行在共享驱动器安装程序时,得到了错误的样子: enter image description here

回答

1

您的问题无关,与一个共享驱动器。

这是由于HOMEPATH变量。它的价值就像\Users\username。路上没有驱动器。所以它只能运行,如果你从C:驱动器运行安装程序。如果你从其他地方运行它,路径自然会被错误地解析。

您必须使用绝对路径。您可以使用USERPROFILE变量而不是HOMEPATHUSERPROFILE的值与C:\Users\username相似。

相关问题