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