1
我的Inno Script安装程序在C:驱动器中创建一个空文件夹,但只在一台机器上。我已经测试过这个脚本的每一台机器都没有这个问题。我已经在两台Windows 7电脑,一台XP电脑和一台Windows XP虚拟电脑上进行了测试。对于所有这些计算机,安装程序不会创建此空文件夹。Inno Script:奇怪的空文件夹
但是,在我的同事的Windows XP计算机上,安装程序的行为与它应该的相同,只是它也在C驱动器上创建了一个空目录。卸载不会删除该文件夹。
我已经看过我的脚本,并寻找可能创建额外文件夹的东西,但我什么也看不见。这是特别难以解决的,因为我似乎无法复制这个问题。
有没有人在这里有一个想法,为什么会发生这种情况?
#define MyAppName "Program1"
#define MyAppVersion "1.0"
#define MyAppExeName "program1.exe"
[Setup]
AppName=Test
AppVersion=1.0
AppPublisher=Me
AppSupportURL=www.google.com
AppUpdatesURL= www.google.com
DefaultDirName={code:getDirectory}
UsePreviousAppDir=no
DisableDirPage=yes
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
OutputBaseFilename={#MyAppName} {#MyAppVersion} Setup
Compression=lzma
SolidCompression=yes
OutputDir=output
UninstallFilesDir={code:getDirectory}
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
[Files]
Source: "test.iss"; DestDir: "{code:getDirectory}"; Flags: ignoreversion;
[Code]
var
InstallTestVersionCheckBox: TNewCheckBox;
Directory : string;
// ------------------------------
// INSTALL
// ------------------------------
procedure InitializeWizard;
var
MainPage: TWizardPage;
begin
MainPage := CreateCustomPage(wpWelcome, 'text', 'text');
// make the checkbox
InstallTestVersionCheckBox := TNewCheckBox.Create(MainPage);
InstallTestVersionCheckBox.Parent := MainPage.Surface;
InstallTestVersionCheckBox.Caption := 'Test Version';
end;
function InstallTestVersion: Boolean;
begin
Result := InstallTestVersionCheckBox.Checked;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if InstallTestVersion() then
begin
// Set the test version directory
Directory := ExpandConstant('{pf32}\Testversion');
end
else
begin
// Set the production version directory
Directory := ExpandConstant('{pf32}\Normal');
end;
end;
// Returns the correct directory
function getDirectory(Param: String): String;
begin
Result := Directory;
end;
据我知道,创新安装自动创建的唯一文件夹是自己的临时文件夹,但它不是空而向导正在运行,并应在完成后删除。 – TLama
检查TEMP文件夹是否在这台机器上正确设置和访问。可能会发生TEMP未设置或无法访问并且安装程序尝试在根目录C:\上创建自己的临时文件夹。例如。如果未设置WorkingDir,则M $ .NET和VC++可以在ROOT C或其他磁盘上(通常在可用空间最大的磁盘上)创建自己的临时文件夹。 – RobeN
感谢您的回复,我会研究这一点。 – user2823160