Prevent appending last word from the default path to the user selected folder

46 views
Skip to first unread message

Arshad Kunnath

unread,
Jul 28, 2025, 3:31:34 AMJul 28
to innosetup
Hi, 
I have created a simple inno setup installation package, which will copy few files from a folder to the destination folder - DefaultDirName or User selected path. But each time if user selects one folder, the last name from the default path is appending to the user selection. How that can be avoided ?

Arshad Kunnath

unread,
Jul 28, 2025, 4:07:58 AMJul 28
to innosetup
[Setup]
AppName=Plugin_Ings
AppVersion=1.0
DefaultDirName={code:GetInstallDir}
DisableProgramGroupPage=yes

Uninstallable=no
OutputDir=.
OutputBaseFilename=Plugin_Ings
Compression=lzma
SolidCompression=yes

[Files]
; Copies all files in the folder flat (no subfolders)
Source: "D:\Work\Ingstron\ANSA-Pluggin\Source_Files\*"; DestDir: "{app}"; Flags: ignoreversion

[Run]
; Optional: run something after install
; Filename: "{app}\your_file.py"; Flags: postinstall skipifsilent nowait

[Code]
function GetInstallDir(Default: String): String;
begin
  Result := 'C:\config\plugins';  // You can change this to any default base folder
end;


This is the script written. When manually select a folder, the term 'plugins' is attached with the selected path automatically. How to provent.

Martijn Laan

unread,
Jul 28, 2025, 8:22:38 AMJul 28
to innosetup

Greetings,
Martijn Laan

Op maandag 28 juli 2025 om 09:31 schreef Arshad Kunnath <arsh...@gmail.com>:
Hi,
I have created a simple inno setup installation package, which will copy few files from a folder to the destination folder - DefaultDirName or User selected path. But each time if user selects one folder, the last name from the default path is appending to the user selection. How that can be avoided ?

--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/38413069-6bc1-4d25-b222-a7aad492125en%40googlegroups.com.

Arshad Kunnath

unread,
Jul 31, 2025, 6:34:11 AMJul 31
to innosetup
Thank you Marijn Laan. It helps. 
Reply all
Reply to author
Forward
0 new messages