|
Post by jarych on Jul 2, 2019 5:42:24 GMT
Subject supposed to be: destination path for self-extraction package of a JB-made program
Some bad choices would be ... Program Files..., ...documents..., or anywhere in AppData.
We can create a program application which could work as a portable program, so it might be runnable on usb flash drive, or it might be runnable in a folder or subfolder on the user's computer. For an ordinary zipped package, user can choose where he wants to unpack the application. My understanding of SFX file is that a default path for destination is set according to the person who makes the SFX package.
I find a couple of interesting paths when searching in File Explorer of Windows 10. They are these: C:\Users\Admin C:\Users\Public
And instead of "Admin" on some computers, there is a path with the assigned variable folder named to something more specific, C:\Users\username
How could or should we setup the destination unpack path for such a SFX file, if we : (1) Do not know if the destination computer will have the Admin subfolder or the username subfolder. (2) Do not know in advance, the username subfolder of the destination computer. ?
Can the end user who unpacks the SFX file pick the destination path the way he wants, like anywhere else in C:\Users, or if chosen into Documents, or if desired, into Desktop or if desired, into a SUBFOLDER on or in Desktop? Would presetting destination as C:\Users\Public, be an acceptable one?
|
|
|
Post by Rod on Jul 2, 2019 10:38:22 GMT
I mentioned in another thread that you should avoid coding "hard" paths if you are distributing software. You don't even know the user will be using drive c:. Also you will not know what permission the user has on their Windows system. They may be denied access to your chosen destination.
Simple solution, don't code any paths, if you do, make sure they are "relative" / sub paths to your project directory. Zip your project directory, sub directories will be included in the .zip, distribute that.
Now your user can unzip and choose wherever they wish to store your project directory. They will only be able to choose drives and folders they have permission to access. You might give guidance about where they should choose c:\mysoftware for example. You would also need to give guidance on how to navigate to the .exe and start it.
If you really want to do it properly you will need to explore Installer packages that are available. These packages understand the Windows environment and will automate the whole process of installing, creating desktop icons and permissions as they go.
|
|
|
Post by jarych on Jul 2, 2019 12:17:34 GMT
Maybe a simple installer would be better. My programs, even if they do not get developed thoroughly, will usually be small enough to be runnable as portable, all in one folder, and at most, maybe a shortcut onto user's desktop is as fancy a result as needed. That is all why just a compressed file, and possibly a self-extracting zipped file, is what I am interested in using/knowing/learning.
Test-trying an archive tool on a small sample of document files for zipping and forming into self-extract EXE seems to show that when this compressed EXE is run, the initial shown default destination is whatever subdirectory path the self-extract EXE is currently placed. There is an abbreviated "browser" button which lets the user choose any extraction destination path he wants. The archive tool never did show any option for the archive-maker user to set any default extraction path. As seen, THAT default path is whichever path the self-extractor is in when it is run.
|
|
|
Post by Rod on Jul 2, 2019 18:01:04 GMT
There is no such thing as a simpler installer. Carl has given us all we need. Use the runtime advice, keep everything in one folder with no declared paths or if you must put resources in sub folders and use relative paths to access those resources. But why bother, just put everything your project needs in one folder, zip that and your user has everything they need contained in one location.
Try it, create a simple program that displays a .bmp. Have the .tkn .exe .bmp and all .dlls in a single folder. Zip that folder. Disrtribute it and folks wil easily be able to run your .exe and display the .bmp. It need not be any more complex.
|
|
|
Post by jarych on Jul 2, 2019 21:52:21 GMT
There is no such thing as a simpler installer. Carl has given us all we need. Use the runtime advice, keep everything in one folder with no declared paths or if you must put resources in sub folders and use relative paths to access those resources. But why bother, just put everything your project needs in one folder, zip that and your user has everything they need contained in one location. Try it, create a simple program that displays a .bmp. Have the .tkn .exe .bmp and all .dlls in a single folder. Zip that folder. Disrtribute it and folks wil easily be able to run your .exe and display the .bmp. It need not be any more complex. I don't really want to make an extra folder for building either an installer or a zipped file or a self-extracting EXE file, although I know I can make such a folder. There was, many years ago, something called Levent's Setup Maker, or Levant's Setup Maker which did make use of all files in the folder to create an installer for just the contents of that folder. Just BASIC, as far as I know, does not have a way to help the JB user create an installer package; only instructions on what files to put together in order to distribute a finished program created using JB. Also I'm less sure that I want to create an installer file. I am interested in letting user unpack into destination folder of his choice, and later, to get rid of the unpacked program, just need to delete the folder without the need to Uninstall using Control Panel.
|
|
|
Post by Rod on Jul 3, 2019 11:36:31 GMT
Well that is precisely what you will achieve by putting everything in a single folder and zipping it. Why do we put it all in a single folder? Firstly we can easily zip the folder by right clicking it and selecting "send to" then "zipped folder". Secondly the user can unzip to wherever he wants and later delete everything simply by deleting the folder. Thirdly its is all self contained, we need to know nothing about the users computer, his permissions or drive system.
The user will need to be told how to navigate to and click on the .exe to start the program.
If you distribute on a USB drive you don't even need to zip the folder. That is only a convenience for downloading speed.
But we have drifted away from your initial question.
|
|
|
Post by jarych on Jul 3, 2019 19:11:33 GMT
jarych original question or topic:
Rod says:
The answer is, making the zipped archive or the self-extracting archive does not set any unpack-destination path. Choosing this path is entirely the end-user's choice. Any "default" path shown depends on where the self-extracting file is on the end-user's computer. I HAD TO actually create a self-extracting archive in order to see this. ( I used ZipWare to make the SFX file, if this makes any difference . )
|
|