I would like to know how to fix this kind of Error:
You must enter a full path with drive letter; for example: C:\APP or a UNC path in the form: \server\share
This appears whenever I try to force the Inno Setup Compiler (5.5.5 u) to put my stuff into, let say H:\
instead of H:\New Folder
.
I need the compiler to customize my destination location to H:\
.
Here is my sample program;
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={drive:F:}
AppendDefaultDirName=no
[Files]
Source: "File1.txt"; DestDir: "{code:GetExeLocation|{app}\My_Portable_App}"; \
Flags: ignoreversion
[Code]
var
UsagePage: TInputOptionWizardPage;
procedure InitializeWizard;
begin
{ Create the pages }
UsagePage := CreateInputOptionPage(wpWelcome,
'Installation Type', 'Select Installation Option',
'Where would you like to install this program',
True, False);
UsagePage.Add('Normal – PC Hard Disk Installation ');
UsagePage.Add('Portable – USB Drive Installation');
{Set Default – Normal Install}
UsagePage.SelectedValueIndex := 0;
end;
var
bIsPortable : Boolean;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
// If we have clicked the next button on our custom page.
if (CurPageID = UsagePage.ID) then
begin
bIsPortable := not (UsagePage.SelectedValueIndex = 0);
end;
result := true; // need to return a value so next key has an impact
end;
function GetExeLocation (Param: String) : String;
begin
if bIsPortable then
result := Param
else
result := Param;
end;
function InstallType(sRequiredType:String):Boolean;
begin
if sRequiredType = 'Portable' then
result := bIsPortable
else
result := not bIsPortable;
end;
Explanation:
When I select "Normal – PC Hard Disk Installation", as my choice, all my installation files or folders should go to normal Path that is to C:\My Program
, but when I select "Portable – USB Drive Installation" as my Entry, I would like to put all my installation files or folders directly into the USB Pen drive Root, that is in here H:\
, where "H" is my USB Pen Drive letter which I have selected to put my stuff in. But my Program does not allow me to do so, instead it adds a New Folder by default to put my installation files or folders over there, that is to H:\New Folder
which I do not need that at all!. And when I force to do what I want, it ends giving me an Error!
Please I need Your Help to fix this, and if this inno-setup can not do what I want, please point me another one, and I will be Thankful for that!
EDIT:
Let focus on the second choice that is "('portable – usb drive installation')" because that is my real target.
From the Source: I made some changes so that to make it more clear.
I added my destination Directory, that is {code:GetExeLocation|{app}\My_Portable_App}
. So what I want here is that, all my installation files or folders to be installed inside this directory, I mean My_Portable_App
. And the path to my USB pen drive should be H:\My_Portable_App
. So when this goes fine, I want to see only This Folder My_Portable_App
in my USB pen drive that will contain all my stuffs in there!!!
Thanks in advance!