Recent

Author Topic: Inno Setup Compiler  (Read 2957 times)

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 421
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Inno Setup Compiler
« on: February 01, 2025, 09:16:33 pm »
Okay, made this work but the ContactsMgt.iss, see below I replaced what
I had yesterday with a new one.  The only issue is it installed into the
Program Files (x86) directory instead of the root directory C:\Contacts Mgt\
The variable {autopf} for the DefaultDirName means C:\Program Files (x86)\
I assume. Next, I'm going to remove the {autopf} from the line in [Setup]
DefaultDirName={autopf}\Contacts Mgt with just
DefaultDirName=\Contacts Mgt and see if that works...
Also, the Uninstall.iss created by this script uninstalled everything in the Program Files (x86) directory, cool!

I'm testing Inno Setup Compiler on a simple Contact Mgt. app. I programmed learning Lazarus awhile back. Just for a test I wanted to setup Inno to be able to install the ContactsMgt.exe in the root C: into a created directory called Contacts Management. Then install the data files, i.e. nine files Contacts.dbf, Categories.dbf, Countries.dbf, STProvCodes.dbf and their *.mdx and one memo file *.dbt into a created subdirectory under Contacts Management directory called Data.  See the sample ContactsMgt.iss below I'm toying with.

Code: Pascal  [Select][+][-]
  1.  
  2. ; -- ContactsMgt.iss --
  3. ; Copy ContactsMgt.exe, DataBase Schema and also create the application icon.
  4. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING THE .ISS SCRIPT FILES!
  5. ; Install the ContacsMgt.exe, ContactsMgt.ico into the folder C:\Contacts
  6. ; Mgt\ and the data files into C:\Contacts Mgt\Data\
  7.  
  8. [Setup]
  9. AppName=Contacts Management
  10. AppVersion=2.0
  11. WizardStyle=modern
  12. DefaultDirName={autopf}\Contacts Mgt
  13. DefaultGroupName=Contacts Mangement
  14. UninstallDisplayIcon={app}\ContactsMgt.exe
  15. Compression=lzma2
  16. SolidCompression=yes
  17. ; Install into root\Contacts Mgt
  18. ;OutputDir=Install-Setup:Contacts Mgt Output
  19.  
  20. [Files]
  21. Source: "ContactsMgt.exe"; DestDir: "{app}"
  22. Source: "ContactsMgt.ico"; DestDir: "{app}"
  23. ; Source: "ContactsMgt.chm"; DestDir: "{app}"
  24. ; Source: {userappdata}; DestDir: "{app}\data\"
  25. Source: "Data\Contacts.dbf"; DestDir: "{app}\Data\"
  26. Source: "Data\Contacts.mdx"; DestDir: "{app}\Data\"
  27. Source: "Data\Contacts.dbt"; DestDir: "{app}\data\"
  28. Source: "Data\Categories.dbf"; DestDir: "{app}\data\"
  29. Source: "Data\Categories.mdx"; DestDir: "{app}\data\"
  30. Source: "Data\Countries.dbf"; DestDir: "{app}\data\"
  31. Source: "Data\Countries.mdx"; DestDir: "{app}\data\"
  32. Source: "Data\STProvCodes.dbf"; DestDir: "{app}\data\"
  33. Source: "Data\STProvCodes.mdx"; DestDir: "{app}\data\"
  34.  
  35. [Icons]
  36. Name: "{group}\Contacts"; Filename: "{app}\ContactsMgt.ico"
  37.  
  38.  
« Last Edit: February 02, 2025, 08:54:27 pm by 1HuntnMan »

silvercoder70

  • Full Member
  • ***
  • Posts: 200
    • Tim Coates
Re: Inno Setup Compiler
« Reply #1 on: February 01, 2025, 10:00:06 pm »
looks correct for what you have at the moment:

- you need to add the database files into the [Files] section as well as the .ico.
- the path for them would be {app}\data\
- also make sure any dependencies (DLLs) required as added to the [Files] section.

PS. I have used inno setup for too long - when I was working commercially, it was the tool used at the place I worked at and guess who wrote it.
🔥 Pascal Isn’t Dead -> See What It Can Do: @silvercoder70 on YouTube

lainz

  • Hero Member
  • *****
  • Posts: 4740
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Inno Setup Compiler
« Reply #2 on: February 02, 2025, 03:56:41 am »
If you install it in program files you can't write the database in the same folder else you must run your app as administrator.

Better install it without privileges in app data folder.

dbannon

  • Hero Member
  • *****
  • Posts: 3647
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Inno Setup Compiler
« Reply #3 on: February 02, 2025, 08:16:22 am »
Here is the .iss file I use. 

https://github.com/tomboy-notes/tomboy-ng/blob/master/package/tomboy-ng.iss

I build a 64 and 32bit binary (on a Linux box and cross compile, not your way I expect) and then my packaging script bundles all the necessary files, binaries, help notes, a DLL etc into a directory. And, the .iss file. I reuse the same .iss file for every release of my app by using a replaceable parameter, "REPLACEME" with an appropriate version number using sed but you would need a Windows tool to do the same thing I guess.

Then, that directory goes to a Windows box (with Inno installed), double click on the .iss file. All done. Been working flawlessly for several years now.

Good luck !

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

msintle

  • Sr. Member
  • ****
  • Posts: 358
Re: Inno Setup Compiler
« Reply #4 on: February 02, 2025, 12:41:49 pm »
Or, look at InstallAware Multi Platform (built with Lazarus). 100% free for open source projects!

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12593
  • FPC developer.
Re: Inno Setup Compiler
« Reply #5 on: February 02, 2025, 01:13:18 pm »
The FPC inno setup .ist (don't know why they are called that way) files are in the fpcbuild repository in the install/ dir.

Thaddy

  • Hero Member
  • *****
  • Posts: 18676
  • Jungle wars. And failing health it seems.
Re: Inno Setup Compiler
« Reply #6 on: February 02, 2025, 03:38:25 pm »
@Marco
I haven't used Inno Setup in 25 years or so but isn't it: inno setup template?
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 421
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: Inno Setup Compiler
« Reply #7 on: February 02, 2025, 09:17:57 pm »
Success. Solved the issue of installing into the C:\Program Files (x86)\Contacts Mgt\ directory by changing the line:
; DefaultDirName={autopf}\Contacts Mgt to just
DefaultDirName=\Contacts Mgt

Now, I'm going to figure out how to place a Shortcut on the desktop that points to the ContactsMgt.exe in C:\Contacts Mgt directory and also figure out how to make the Uninstall file named UninstallContactsMgt.exe instead of unins000.exe.  Also, tested going into Winders 11 Pro under Apps and Features and found the Contacts Mgt app and uninstalled that way but it displays the unins000.exe which I want the user to be able to see UninstallContactsMgt.exe.

msintle

  • Sr. Member
  • ****
  • Posts: 358
Re: Inno Setup Compiler
« Reply #8 on: February 03, 2025, 01:20:30 pm »
Oh man, so much work for problems that ought to have been solved decades ago.

lainz

  • Hero Member
  • *****
  • Posts: 4740
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Inno Setup Compiler
« Reply #9 on: February 03, 2025, 02:07:27 pm »
Oh man, so much work for problems that ought to have been solved decades ago.

Inno setup is easy to use, no problems at all. It has all solved, but for a newcomer maybe it's a bit hard to understand...

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 421
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: Inno Setup Compiler
« Reply #10 on: February 03, 2025, 02:57:57 pm »
MSIntle,
    You mentioned InstallAware Multi Platform (built with Lazarus). 100% free for open source projects. It looks like there's a cost involved. I'll see if I can download the free version and check it out.
    Thanks, 1HuntnMan

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 421
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: Inno Setup Compiler
« Reply #11 on: February 03, 2025, 05:53:50 pm »
I tried installing InstallAware X17. Took a look then uninstalled it, I think I'll stick with Inno Setup Compiler.

silvercoder70

  • Full Member
  • ***
  • Posts: 200
    • Tim Coates
Re: Inno Setup Compiler
« Reply #12 on: February 03, 2025, 11:15:06 pm »
Hi. Can you tell me where you (the user) saw reference to unins000.exe program?
🔥 Pascal Isn’t Dead -> See What It Can Do: @silvercoder70 on YouTube

lainz

  • Hero Member
  • *****
  • Posts: 4740
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Inno Setup Compiler
« Reply #13 on: February 04, 2025, 01:38:04 am »
If I remember correctly the unins000 is a way to keep several uninstallers in the same folder. So you better keep it like that: unins000 unins001 and so on.

The user see in Applications the name of your app. Never the name of the exe. If you want put it in a subfolder called uninstall or something like that.


silvercoder70

  • Full Member
  • ***
  • Posts: 200
    • Tim Coates
Re: Inno Setup Compiler
« Reply #14 on: February 04, 2025, 06:32:55 am »
Yes. I would treat that as part of the windows install/uninstall system and leave  that part alone. And hopefully,  if the application is good enough the users never go near the uninstall action.

Lastly,  and hopefully this does not come across as being critical... the ease of installing and smoothness of the operation and the application itself are far more important than the name of the uninstall program.
🔥 Pascal Isn’t Dead -> See What It Can Do: @silvercoder70 on YouTube

 

TinyPortal © 2005-2018