Inno Setup install script from CD/DVD drive (variable path) - path

I am trying to write a Inno Setup script to install files from a CD drive to a predefined system C drive folder. Naturally, the CD/DVD ROM may have a different path ID on different systems. How do I code this variable path for the Source Files?

Assuming your installer is located along with the files you are going to install, you can use the {src} constant to refer to installer's folder along with the external flag:
[Files]
Source: "{src}\file.dat"; DestDir: "..."; Flags: external
If your installer is located elsewhere, there's no generic solution. Note that there may be even more CD/DVD drives on the computer.
You would have to programmatically enumerate all drives, testing for their type (CD/DVD) and presence of certain files for example.

Related

MSIX: Set Installation Path

How to change the MSIX installation path??
Referred this url - "https://learn.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-scenes"
Always installer package is created in default location "C:\Program Files\WindowsApps"
Need to set the installer location to different location.
The installation path of an MSIX package cannot be changed. All the files you have included in your package are installed inside an app-specific folder under "C:\Program Files\WindowsApps<your app>\".
This is a design decision from Microsoft. Only for MSI/EXE installers you can change the install path.
If you want to add files in other folders too, you need to copy them the first time your application is launched. For that, you have multiple options. You can write your own code inside your application to copy the files in other folders or you can use tools like Advanced Installer to do it for you.
To understand more about MSIX and how files outside of the installation path can be managed I recommend this article/presentation I wrote last month.

Can you use Java JPackage to create own Windows installer without using its way of running application

Background, I currently use Izpack for my Windows installer, I bundle a java runtime and use winrun4j as a wrapper both for the installation and the actual program once installed. It worked for a long time but there are a number of problems with the installer that I have not been able to solve and have been looking to replace it.
Oracle now provide the JPackage installer so it seems like a sensible choice. But the folder structure created by the installer is different to what I currently have, I have a number of config and non java files and I have not been able to get the .exe that JPackage creates to do anything.
So is it possible to use JPackage to create the installer but in a strcuture better matching my existing structure, and use continue to use WInRun4j to actyally run my application
Existing Folder Structure
ROOT
---App.exe
---Config Files
---lib
-------jar files
---JVM64
------- Java runtime
---help
JPackage structure
ROOT
---App.exe
---Runtime Dlls
---app
----- jar files
Config files
--runtime
------Java runtime
------Runtime Dlls (again)
The structure of directories generated by jpackage is mainly set up for you and does not seem possible to change, and makes installation of Java app dependencies very easy with self contained JRE. The basic structure for Windows is as you say:
ROOT
---App.exe (for --main-class parameter)
---xyz.exe (for each --add-launcher parameter)
---Runtime Dlls (these appear to be unused except for applauncher.dll, see SO 62607300)
---app/
------App.cfg (for --main-class)
------xyz.cfg (for per --add-launcher)
---runtime/
------Java runtime
------Runtime Dlls
With --input and --main-jar params you are free to setup additional directory structure under app/ folder for anything else you want for your application. So if you used lib/myappjar.jar it would add:
---app/
-------lib/
----------myappjar.jar
If you used --input build\mypath it would copy the entire tree of files under that folder, so if build\mypath dir contained
bin/
---Scripts
---xyz.properties
README.txt
Then app would also contain:
---app/
------bin/
---------Scripts
---------xyz.properties
------README.txt
By the way the Runtime DLLs placed at top level appear to be copies of some of the DLLs under runtime/bin
[https://stackoverflow.com/questions/62607300/why-is-java-jpackage-installing-windows-dll-files-in-two-places]

D5 library folder (not the Library Paths)

just had a crash with an SSD (a days work went missing!) and have had to go back to a HDD.
I have just installed D5 on the HDD and would like to try and find the Library Paths file so I can just copy it all across. There are about 40 Path-entries in it.
Using a USB adapter I searched the SSD for file contents with a fragment of a Path that the file contains but it came up zip.
$(DELPHI)\Lib;$(DELPHI)\Bin;
Can anyone one please point me at where the Library Paths are actually stored?
Thank you.
There is no "Library Paths file".
The $(DELPHI) part of what you quoted refers to your Delphi installation root (base) folder, which in the case of Delphi 5 defaults to C:\Program Files\Borland\Delphi5, so the $(DELPHI)\Lib folder would be C:\Program Files\Borland\Delphi5\Lib.
This path information is configured when you install Delphi, and is stored in the Windows Registry in HKEY_CURRENT_USER\Software\Borland\Delphi\5.0\RootDir for Delphi 5.
The "about 40 paths" probably refers to what you've configured in Tools->Environment Options->Library->Library Path; that information is also saved in the Windows Registry. If you can't boot Windows from the SSD drive, you're out of luck; you need to start Windows and then use RegEdit to export that key from the registry in order to recover that information. You'll need to reinstall your third-party components, I'm afraid.
Further to Ken's answer, if the SSD is readable and mounted as an additional drive you can get the registry settings: DISCLAIMER: This is mainly from memory, but I have done this in a similar situation.
Copy NTUSER.DAT from (SSD):\Users\<username> to a "safe place". You will have to uncheck the "Hide protected operating system files" option from Explorer Folder Options, or use the command line for this.
Run regedit. Select the HKEY_USERS key, the use File -> Load Hive and select the NTUSER.dat file uou copied from the old drive.
Hopefully this will load your registry settings from the old computer into a new key under HKEY_USERS
Find Software\Borland\Delphi\5.0\ in the new hive, then export whatever subkeys you need to a .reg file
Tweak the exported file(s) - you will need to change the key names to HKEY_CURRENT_USER\Software\Borland\Delphi...\*
Unload the registry hive
Backup your existing HKEY_CURRENT_USER\Software\Borland\Delphi reg key
Check then import the tweaked registry file
This is almost a question for SuperUser!

delphi 2009 compile packages

i truly don't get it.
trying to recompile the qr5 packages, and is impossible with this Delphi.
build the QR5Run_Rad6.bpl, everything is fine.
when i install QR5Design_RAD6.bpl an error message appears
"its not possible to run the program since qr5run_rad.bpl is missing in your computer. try again installing your program to solve this problem."
just did!
clean build compile doesn't work in any order. closed the ide and reopened , still doesn't work.
what else is left?
clean all related dcp and bpl
QR5Design_RAD6.bpl <> qr5run_rad.bpl
And more importantly, the qr5run_rad.bpl needs to be found on the systempath in order for the IDE to find it so it can be used by the design time package.
In other words: you need to build the qr5run_rad.bpl as well as the QR5Design_RAD6.bpl. And you need to make sure that the qr5run_rad.bpl ends up in a folder that is on your system path, not just any old folder where you have the sources and/or dcu's.
In addition to what Marjan wrote:
Windows uses these places when looking for a DLL (or BPL, which is a DLL):
The directory from which the application loaded.
The system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The current directory.
The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.
Delphi puts BPL files in a directory like C:\Documents and Settings\All Users\Documents\RAD Studio\8.0\Bpl which it adds to your PATH when Delphi is installed. For Delphi 2009, that Path would probably be C:\Documents and Settings\All Users\Documents\RAD Studio\6.0\Bpl on a Windows XP machine.
--jeroen

Can i run Erlang without local admin rights on Windows?

I have a machine which doesn't give me local admin rights. Is it still possible to run erlang on it, as I cannot run a windows .exe installer to install erlang?
You can copy erl.exe (plus the runtime system and all the libraries you need) from another installation and run it without the need to install. As long as you are allowed to execute files it should be okay.
Forgive me for not being as smart as Zubair,
but I would like to know exactly how to do this.
I do not have admin privilege, cannot run installers, and cannot copy files to C:\WINDOWS.
In particular, I cannot write to C:\WINDOWS\WinSxS or C:\WINDOWS\system32.
How do I get a list of exactly what libraries are required by the various erlang executables ?
I have all the MS redistributable libraries and manifests,
but I don't know where to put them to make it work.
The redistributable library structure has directories such as
Microsoft.VC90.ATL, Microsoft.VC90.CRT, etc. Each directory contains relevant dlls and a manifest.
Do I copy all the contents into the ERL_HOME\bin directory or ERL_HOME\erts-x.y.z\bin or ERL_HOME\erts-x.y.z\lib ?
or leave them in some other directory and put those entries in the PATH ?
or do I need to build the paths implied by the manifests (i.e. where they would be copied into the WinSxS cache) using hashes and version numbers in the paths, then put those entries in the PATH ?

Resources