|
Post by larrybtoys on Jun 7, 2024 18:52:22 GMT 1
What do you fellas use when combining several files and folders into one simple .EXE?
|
|
|
Post by dragonjim on Jun 7, 2024 19:02:41 GMT 1
Load the files into the main program using the Files tab of the IDE.
|
|
|
Post by larrybtoys on Jun 7, 2024 19:48:04 GMT 1
Can you explain. I see no way to do this. I want to combine several folders with sound files, image files, etc into 1 .EXE file
|
|
|
Post by dragonjim on Jun 7, 2024 21:39:03 GMT 1
I could go into an in-depth description here but it is probably better for the moment that I direct you to the basics which are in the Help File.
Search for "Files Window" in the Index (it should be Files Tab, so I will have to change that) and you should come to a page titled The :Files Tab.
This should cover much of what you need to know, but if it doesn't, please feel free to post again and I will help as best I can.
|
|
|
Post by dragonjim on Jun 7, 2024 21:40:46 GMT 1
As I re-read your question, I should ask: do you want to combine them with the program they are associated with? That is my assumption behind the answers I have given.
|
|
|
Post by larrybtoys on Jun 7, 2024 22:09:23 GMT 1
I have an .EXE of a compiled GB32 program. That program once executed will read several sound files in 1 folder, several image files in another folder, 2 instruction files in another folder, and of course the GfaWin23.ocx file. I want to combine them all into 1 .EXE file and have it run. I don't want to make it easy for users to grab my image or sound files. I want to make it seem as if there is only 1 giant .EXE file which contains everything needed to run the program.
|
|
|
Post by dragonjim on Jun 7, 2024 22:54:55 GMT 1
Then you can add all but the Gfa Ocx to the main program using the Files Tab. You have to add the files manually and then you will need to rename all calls to these files to correspond with the new inline files as described in the help file.
Most of the information you need should be on the Files Window page in the help file. Sadly, I am not near a computer at the moment, so am having to write this from memory; however, it is a simple enough process and does everything you want.
Just out of interest, the files which become part of the EXE file are not stored in native format, but packed and then MiMeEncoded, so, although it is not impossible for someone to mine the EXE for your sound and picture files, it is extremely difficult and they would have to have a very good understanding of GFA file constructs, which are purposely NOT described in the Help File.
|
|
|
Post by larrybtoys on Jun 7, 2024 22:58:01 GMT 1
How can I resolve the OCX file? I want to be able to distribute the program
|
|
|
Post by Xavier on Jun 8, 2024 5:00:49 GMT 1
There are perhaps 3rd party programs that will that will package all your files and resources much like how a new version of GB32 is packaged.
One example: Nullsoft Scriptable Install System (NSIS): NSIS is an open-source system that allows you to create both simple and complex Windows installers. It’s lightweight (only 34KB) and suitable for Internet distribution. Features include the ability to install, uninstall, set system settings, extract files, and more. You can also create custom dialogs and interfaces. NSIS supports all major Windows versions from Windows 95 to Windows 10.
|
|
|
Post by dragonjim on Jun 8, 2024 9:27:30 GMT 1
How can I resolve the OCX file? I want to be able to distribute the program The other option is to distribute the OCX and the EXE in a ZIP file. However, although that is simpler, X's suggestion is probably more suited to what you require and will not get pinged so readily by Smartscreen and other threat-derection software. I've always thought it was a shame that the OCX wasn't included in an EXE and then loaded into memory when the program is started.
|
|
|
Post by Xavier on Jun 8, 2024 10:09:07 GMT 1
If we're to believe an avatar... This is a free way to digitally sign your exec file:
She had me at "Hi I'm Emma..."
|
|
|
Post by larrybtoys on Jun 8, 2024 11:53:47 GMT 1
Does this sign the .EXE for my Windows or other peoples windows?
|
|
|
Post by Xavier on Jun 8, 2024 11:57:44 GMT 1
Signing an executable with a digital signature does not automatically ensure it's trusted on all Windows systems. The digital signature verifies the identity of the software publisher and ensures that the code has not been altered or corrupted since it was signed. However, whether the signed executable is considered trustworthy depends on several factors: - **Certificate Authority (CA)**: The digital signature should be from a CA that is trusted by Windows. If the CA is not recognized or trusted, the signature may not carry much weight.
- **Reputation**: Newly signed executables may still trigger warnings until they build a reputation. Microsoft SmartScreen, for example, uses reputation-based protection that can flag new files.
- **User Settings**: Individual user settings and policies can affect how signed executables are treated. Some users or organizations may have stricter security settings that require additional verification.
- **Windows Version**: Different versions of Windows may handle signed executables differently, especially if the signature uses newer algorithms not supported by older versions. For your executable to be considered trustworthy across different Windows systems, it should be signed with a certificate from a well-known and trusted CA. Additionally, passing through the validation steps and building a positive reputation over time can help reduce security warnings for users¹²³. Remember, even with a valid digital signature, users may still encounter prompts asking if they trust the software, especially if it's not widely recognized yet. It's part of the security measures to protect users from potentially harmful software. Source: Conversation with Copilot, 2024-06-08 (1) Trusted Signing FAQ | Microsoft Learn. learn.microsoft.com/en-us/azure/trusted-signing/faq. (2) digital signature - How can I make my executable considered trustworthy .... stackoverflow.com/questions/52508531/how-can-i-make-my-executable-considered-trustworthy-by-windows-and-common-antivi. (3) How to Digitally Sign Executable Files and Why It’s Important. codesigningstore.com/how-to-digitally-sign-executable-files. (4) Code Signing: Can you trust that executable?. symantec-enterprise-blogs.security.com/blogs/expert-perspectives/code-signing-can-you-trust-executable.
|
|
|
Post by larrybtoys on Jun 8, 2024 12:08:33 GMT 1
Based on what I have been reading it seems that if enough people (many 1000's) were using GB32 and trusting .EXE files the virus companies would begin to recognize it as safe.
|
|
|
Post by larrybtoys on Jun 8, 2024 12:10:20 GMT 1
How can I resolve the OCX file? I want to be able to distribute the program The other option is to distribute the OCX and the EXE in a ZIP file. However, although that is simpler, X's suggestion is probably more suited to what you require and will not get pinged so readily by Smartscreen and other threat-derection software. I've always thought it was a shame that the OCX wasn't included in an EXE and then loaded into memory when the program is started. I totally agree. The .OCX should be included in the .EXE version of any program
|
|
|
Post by Xavier on Jun 8, 2024 12:14:41 GMT 1
The other option is to distribute the OCX and the EXE in a ZIP file. However, although that is simpler, X's suggestion is probably more suited to what you require and will not get pinged so readily by Smartscreen and other threat-derection software. I've always thought it was a shame that the OCX wasn't included in an EXE and then loaded into memory when the program is started. I totally agree. The .OCX should be included in the .EXE version of any program Could we write our own exec perhaps in C# that would do just that? All this executable does is unpack your GFA-BASIC 32 executable file and the OCX then deletes itself perhaps?
Now I'm thinking doesn't winzip do exactly that? It zips up your files in one exec, the user extracts all, wallah!
|
|
|
Post by Xavier on Jun 8, 2024 12:19:32 GMT 1
Distributing OCX controls and executables within a ZIP file is indeed a simpler method, but as you mentioned, it might not be the most elegant or user-friendly approach, especially considering the potential flags from SmartScreen and other security software. Embedding OCX files within an EXE is a concept that has been considered by developers for ease of use and distribution. However, this isn’t natively supported due to the way OCX controls are registered and used by the operating system. Creating a custom executable in C# that unpacks the necessary files and registers the OCX at runtime is a feasible solution. This executable would essentially act as a self-extracting installer. Here’s a high-level overview of what the C# code could do: Embed the OCX and any other required files as resources within the C# project. Upon execution, extract these resources to a temporary location. Register the OCX using regsvr32 or similar methods programmatically. Launch the main application. Clean up by unregistering the OCX and deleting the temporary files upon application exit. This approach would require administrative privileges to register and unregister the OCX control. As for the comparison with WinZip, self-extracting archives created by WinZip or similar software do allow users to extract all files with a single click. However, they typically don’t handle registration of components like OCX files. Your custom executable would have the advantage of handling these additional steps automatically. Here’s a simple C# example that demonstrates how you might embed and extract a file:
using System; using System.IO; using System.Reflection;
class Program { static void Main() { // Extract the embedded resource to a temporary location var assembly = Assembly.GetExecutingAssembly(); var resourceName = "YourNamespace.YourResourceName.ocx"; var tempFile = Path.GetTempFileName();
using (var stream = assembly.GetManifestResourceStream(resourceName)) using (var fileStream = File.Create(tempFile)) { stream.CopyTo(fileStream); }
// TODO: Add code to register the OCX, start the main application, and clean up } }
|
|
|
Post by Xavier on Jun 8, 2024 12:21:35 GMT 1
To register an OCX file in C#, you can use the `regsvr32` command through the `System.Diagnostics.Process` class. Here's an example of how you might do it: using System.Diagnostics;
class Program { static void Main(string[] args) { // Replace 'yourOCX.ocx' with the path to your OCX file string ocxPath = @"C:\path\to\yourOCX.ocx";
// Register the OCX file Process process = new Process(); process.StartInfo.FileName = "regsvr32"; process.StartInfo.Arguments = "/s " + "\"" + ocxPath + "\""; // /s for silent mode without dialogs process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = true; process.Start();
// Wait for the process to finish process.WaitForExit();
// Check the exit code int exitCode = process.ExitCode; if(exitCode == 0) { Console.WriteLine("OCX registered successfully."); } else { Console.WriteLine("OCX registration failed with exit code: " + exitCode); } } }
This code snippet creates a new process to run the `regsvr32` command with the path to the OCX file as an argument. The `/s` switch is used to run `regsvr32` in silent mode, which suppresses message boxes. The `UseShellExecute` property is set to `false` to allow redirection of the standard input/output/error streams, and `CreateNoWindow` is set to `true` to prevent the command window from appearing. Remember to replace `"C:\path\to\yourOCX.ocx"` with the actual path to your OCX file. Also, ensure that the application has the necessary permissions to register the OCX file, as this typically requires administrative privileges¹. If you prefer to register the OCX without using the `regsvr32` external program, you can use P/Invoke to call the necessary Windows API functions directly from C#. However, this approach is more complex and beyond the scope of a simple example. For more information on this method, you can refer to community discussions and resources¹. Source: Conversation with Copilot, 2024-06-08 (1) c# - How to register .ocx file from code - Stack Overflow. stackoverflow.com/questions/7185309/how-to-register-ocx-file-from-code. (2) How to use ocx in .Net windows application - Stack Overflow. stackoverflow.com/questions/2881103/how-to-use-ocx-in-net-windows-application. (3) Registering OCX and DLL files as System Globals - Microsoft Support. support.microsoft.com/en-us/topic/6cf46261-bc77-778c-d6a8-79351a32d9d6. (4) Register OCX and DLL files as system globals - Windows Client. learn.microsoft.com/en-us/troubleshoot/windows-client/application-management/registering-ocx-dll-files-system-globals.
|
|
|
Post by Xavier on Jun 8, 2024 12:29:36 GMT 1
So, do setup.exe creator utilities do all that?
Yes, many setup.exe creator utilities are designed to handle a variety of tasks necessary for software installation, including the registration of OCX files. These utilities often provide a user-friendly interface and automate the process of packaging, distributing, and installing Windows applications. Here are some features commonly found in setup.exe creator utilities: - **Installation**: They can install files, set system settings, and register components like OCX, DLLs, and more¹. - **Uninstallation**: They provide an automated way to cleanly remove the installed application and its components¹. - **Customization**: They allow the creation of custom dialogs and interfaces for user input and configuration options¹. - **Scripting**: Many support script-based logic to handle complex installation tasks¹. - **Compression**: They offer compression methods to reduce the size of the installer package¹. - **Cross-Platform**: Some tools can create installers for different platforms, like Windows and Mac³. - **Web-Based Installation**: They can support web installation and file patching across the Internet¹. These utilities simplify the process of creating a setup.exe by providing pre-defined scripts and plugins, making it easier for developers to create a robust installer without having to write complex code themselves. They can handle the embedding of files, extraction to the correct locations, and registration of components like OCX files during the installation process. For example, a setup.exe created with these tools would typically: 1. Extract the necessary files to the target system. 2. Register any OCX/DLL files using the appropriate methods (similar to `regsvr32`). 3. Create any necessary shortcuts and registry entries. 4. Configure any required system settings. By using a setup.exe creator utility, you can ensure that all the necessary steps for a successful installation are taken care of, which can include the registration of OCX files as part of the installation process. This can help avoid issues with SmartScreen and other threat detection software, as the installation process is handled in a standard and expected manner by the operating system¹²³. Source: Conversation with Copilot, 2024-06-08 (1) 4 Great Tools to Create Windows Installer Packages - Help Desk Geek. helpdeskgeek.com/free-tools-review/4-tools-to-create-windows-installer-packages/. (2) Setup Creator Software to Organize Your Apps Efficiently - Windows Report. windowsreport.com/setup-creator-software/. (3) InstallForge | The Free Setup Creator For Windows. installforge.net/.
|
|
|
Post by Xavier on Jun 8, 2024 12:32:43 GMT 1
If the ocx is in the same dir as the exec won't that be fine?
If the OCX file is in the same directory as the executable (EXE) file, it can simplify the process of registering the OCX, especially if the registration is done programmatically by the application at runtime. However, just having the OCX in the same directory does not automatically register it with the system. The OCX still needs to be registered for it to be recognized and used by the application. Here's why placing the OCX in the same directory as the EXE can be beneficial: - **Relative Paths**: The application can use relative paths to locate and reference the OCX file, which makes it easier to manage and deploy. - **Portability**: It increases the portability of the application, as the necessary components are contained within a single directory. - **Registration Script**: If you have a script or a portion of code within your application that registers the OCX, it can easily find the OCX using a relative path. To register the OCX, you would typically use a command like `regsvr32` with the path to the OCX file. If the OCX is in the same directory as the EXE, the command can be simplified. For example, if you're running the registration command from the same directory as the EXE and OCX, the command might look like this: regsvr32 yourComponent.oc
In a C# application, if you're handling registration programmatically, you might use the `Process` class to execute `regsvr32` with the relative path to the OCX:
Process.Start("regsvr32", "/s yourComponent.ocx");
Remember, registering an OCX usually requires administrative privileges, so your application or setup utility will need to request the necessary permissions from the user. In summary, while having the OCX in the same directory as the EXE is convenient and can facilitate registration, you still need to perform the registration step to make the OCX available to the application.
|
|
|
Post by dragonjim on Jun 10, 2024 17:51:26 GMT 1
The process would be simplified as you do not need to register the OCX; all the EXE does is look for it in the current directory - it used to look in the old SYSTEM32 folder but seems not to anymore - and, if it is there, then loads it into memory.
The problem with the EXE creating the OCX from inline storage if it is not present is that the routines to unpack, decode and copy a file are all included in the OCX; including the code in the EXE would have increased the size of the EXE in the days when the smaller the size, the better - it is just a shame that no one thought of making it optional, although, in the days when GB32 was being written, there was no need for certificates, no Smartscan, antiviruses only used code signatures and it was expected that you would deploy your software using an MSI-compatible installer.
A custom written C# or C++ installer may be the answer but, unless you can get it to produce a standalone EXE, you may find yourself with the same problem of needing to install and load a C# or C++ library to run it, as many compilers use the same principle of GB32 and do not include all the code in the executable - it makes bug fixes easier to install and universal across all programs written using that code.
The other issue would be that it would still need to be signed and certified - as would a GB32 exe which could deploy the OCX - so you may be better off just using a MSI-compatible installer.
|
|