How installation works? - window

I want to know how installation in windows works like what sort of files get created first as .dll , drivers & all.
To be more precise when we click on .exe file what happens internally?

Generally speaking, anything can happen after you click the exe. But most of the time, installer does some or most of these:
check if the needed frameworks and libraries are already installed (ex: .NET framework)
create a registry entry with the application settings and uninstaller path
extract the binaries and assets or download them
create the needed directories (ex: Program Files/SomeProgram) and move the extracted files to the proper folders
create a desktop shortcut
associate the file extensions with the program
do whatever else the program needs.. It really depends on what you are installing and what needs to be set up for the program to
function properly.

Related

How to make WIX create files to Program Files folder in the installation? I have "Access defined"

I am creating a WIX installer project. During one managed customized action, I need to create a file (other than the deployed files specified in the components of WIX) in the installation folder, which by default is the Program Files folder. I am experiencing the "Access denied" problem in Windows 7. After some searching, I found out that people say it is not advisable to create files into Program Files folder. Instead, try to create files into for example AppData folder. For example, see this link:
C# Access denied to path in a Windows Application
But my question is, the generated file is crucial to our SW, so it must reside in the installation folder. Isn't it the target of SW installation, I mean, to create file in most of the cases Program Files folder? Does it mean the only files should be added into installation folder, during the installation, are the deployed files (basically the targets of XCopy)?
My file can't be made deploy-able in the WIX, i.e, it can't be made ready before the installation. So what's the proper way or best practice to handle such situation: a file must be generated during the installation, into the installation folder. It is not some log file that I can put somewhere else. I tried to create a Permission element in WIX for the INSTALLADIR, although it seems to be against the rule mentioned in the link, but it still failed. Thanks!
UPDATE:
Based one MichaelUrman's commen, some more information. The generated file is needed after the SW is installed and necessary during normal launch of the SW. And I think it needs to be modified during normal use after the installation. And as I mentioned my a comment to #caveman_dick answer, my CA is actually in commit phase, I don't know whether there is any difference between it and normal deferred CA
Set the custom action to Execute="deferred", that will run the command elevated and should give it the required permissions to create the file.
Since you need to update that file from the main application, and I'm assuming your application does not require elevated privileges, you have three options.
The first is the worst: without a manifest, your executable's attempts to write to the Program Files folder will typically result in it being redirected to the Virtual Store (see File Virtualization). It sounds like this isn't happening in your case, so you can't use it.
The second option is to modify the application to store this in an appropriate location such as the ProgramData folder, or Common Documents, or (if appropriate) a per-user location under LocalAppData. This is typically the best approach, but has the highest development costs.
Finally the third option is to create the file and change its permissions (or in some cases to change the permissions on the folder containing the file), allowing limited users to modify this file. See LockPermissions or MsiLockPermissionsEx for the Windows Installer way to approach this. Change the permissions on as few files or folders, as restricted as possible, to keep the system as safe as possible if you go with this option.

Windows oriented setup to deploy one file

I would like to build a setup, or something like that (1 file), to deliver a single file to a target system. Plugin for an application, installable to users AppData folder.
After some research I'm still not sure in which direction to look. I can create the setup project with Visual Studio 2010, but all of the options so far seem to be way too heavy or have some flaws.
SetupProject stubbornly wants to create an application folder which I don't need, and complains about installation to user folder. Cab doesn't seem to offer automatic install, oneclick is not available for the project, etc.
Is there an easier setup technology I could use?
Requirements:
Install -> Copy 1 file to a folder
under %userprofile%\3rdpartyapp\ if
it exists (xcopy).
Uninstall -> Delete the file and also
one folder with custom settings
(rmdir \s).
Distribution -> Free for commercial
use.
Maybe I should just pack the file in self extracting c++ exe?
It may be overkill for one file, but I like InnoSetup for creating setup packages. Check it out, and see if it suits you. It is very easy to use and deploy.
Take a look at WiX toolset. It allows creating MSI-based installers, and the installer could be quite simple:
Search for %userprofile%\3rdpartyapp;
Copy the file into it, if it exists;
Fail install or maybe create it, if it does not exist.
Uninstall would be very simple: it would need to remove the installed file. To remove a subfolder of 3rdpartyapp, you can use RemoveFolderEx element.
MSI registers the installed app with Add/Remove Programs Control panel. Uninstall is handled by Windows Installer service, therefore you don't need to copy any additional files or programs to support uninstall.
I think any setup technology is too heavy for one file. I'd go with creating a simple application that would extract the file from its resources stream and copy it into %userprofile%\3rdpartyapp.
Uninstall is trickier: there should be something that can handle the uninstall process. It could be a batch or script (js, vbs) file stored somewhere in user's profile, another simple application or the same one. (Installation process can also be handled with a script.)

NSIS - rebuilding the installer exe file

Suppose I have created an installation exe using NSIS. The exe is a compressed (7zip maybe) file that contains everything to install the application on a fresh machine, and that comprises big exe files (like .NET runtimes, mysql server installer, etc.). I have to send via the Internet the big exe file to another person.
To save time and bandwidth, I'd like to remove the contained big files; I can do that using 7zip to open and extract all the files in the original exe, delete the big ones, rezip using again 7zip. This works up now.
The other party will download the reduced zipped file, but then has to reintroduce the big files in some way, recreating the exe installer.
I don't know how to achieve that. I've tried with paquet builder with no success.
Is that possible?
I don't think it's possible. But I think I have another solution for you. Why don't you simply execute separate executables (like .NET runtime etc) from NSIS bundle? This way you don't need to include them into resulting bundle. Just tell the user to download them and put the into proper place. It would be easier than instructing them to assemble bundle from pieces, no?

Is it possible to have PackageMaker build an installer without "packaging" the content at build time?

I have content to be installed, but it's file and folder layout is determined by the brittle, old, Windows installer. I can't fundamentally alter the structure, and I'd prefer not to alter it at all. I can't put it in a PackageMaker package and somehow get the Windows installer to figure out how to read it, for example.
Is there a way to use PackageMaker without having to bundle up the real content at build time? Is there a way to build the package with symlinks and have PM honor them at run time?
I need to support 10.5-6.
edit: If I could use an uncompressed package, that might be able to share the content files between installers. Is there way to do that?
I'll try to give more info about what I'm doing, if something isn't clear please let me know. Please forgive any redundancy.
I need to create a Mac/PC DVD to install my application. The application consists of either a Mac or Windows "reader app", and about a GB of "content" files. There is an existing Windows installer that reads installs the Windows reader and the content files off the DVD and installs them. It is (unfortunately) not a possibility to change the Windows installer. Therefore, the shared content files on the DVD must remain exactly as they are on the disk, I can not zip or package them up, or anything.
I need to make a Mac installer that will install the Mac app and the content. So, the installer needs to install the content from the folder structure of the DVD, which it will have to look at during install-time. My understanding is that PackageMaker requires you to package up the installed files during the creation "build phase" of the installer. That won't work for me because I can't alter the content on disk.
Sunil said:
During creating installer using packagemaker we can attach both a file and a folder also we can specify the path it will be installed. If u want customized way of storing the installed data eg- in some directory structure then in pre installed script write the script to create directory to be created.
I am not able to "attach" files or folder to the installer when I create it. I need the installer to read the content off the DVD when the user runs the installer.
Let me know if there is something that needs to be clarified further.
It sounds like you want the .pkg to copy the files right from the DVD, instead of having PackageMaker bundle the files into the .pkg, correct?
As far as I know a .pkg cannot do this natively. As NSD has mentioned you can do this in a postinstall/postflight script, but you want to display a proper progress bar. The only option left that I can see is to write a Cocoa app which not only copies the files off the DVD but also displays a progress bar in its GUI, and use that app as the postinstall "script".
During creating installer using packagemaker we can attach both a file and a folder also we can specify the path it will be installed. If u want customized way of storing the installed data eg- in some directory structure then in pre installed script write the script to create directory to be created. Can you please describe your problem more deeply so that i may help you
Write a postinstall or postflight script that copies the files off of the DVD.

How to Deploy VB6 Applications?

How to run the exe file to other system?
Using VB 6
I copied the exe file to other system, then run that exe file, it not working it showing error
“component comdlg32.ocx or one its dependencies not correctly registered a file is missing or invalid”`
Can any one help me how to avoid this error?
When deploying VB6 applications, you should create a Setup, this will manage the DLL's that the VB6 application depends on. Since it is not enough to just copy the .Exe and .Dll's. You also need to register them.
The creation of the setup is included in the VB6 environment.
You can read this http://support.microsoft.com/kb/830761 which is very comprehensive.
1: http://support.microsoft.com/kb/830761 for more information.
Or if you just want the redistributable files check this kb http://support.microsoft.com/kb/290887
Copy and register the comdlg32.ocx on other system. Link: Fix Missing Comdlg32.ocx Run time Error in Portable apps.
Create an installer for your program.
Unless you are deploying your program to really old versions of Windows (prior to XP), one nice alternative is to create an XCopy package using reg-free COM. This is fairly easy for most simple programs using Make My Manifest though it can be done by hand or using other tools if you invest in a little study.
Even then a formal installer package is usually desireable though, if nothing else to create Start Menu shortcuts and set up application workspace directories.
Keep in mind that even the PDWizard is difficult to use blindly. Packaging and deployment is a topic that requires some learning investment.
Outdated or missing comdlg32.ocx runtime library is causing this error. Here is a copy of comdlg32.ocx (~60 Kb Zip). Download the file to the Desktop and extract the comdlg32.ocx to your the Windows\System32 folder.
Note: If you already have a copy of comdlg32.ocx, backup the existing file to a different folder and delete it from System32 folder.
1. Download comdlg32.zip and save to Desktop.
2. Unzip the file using WinZip or any other utility.
3. Extract comdlg32.ocx to Windows\System32 folder.
4. Type the following command from Start, Run dialog:
regsvr32 %Systemroot%\System32\comdlg32.ocx
Typically a VB 6 app will consist of an .exe some .dll libraries and a config.ini file. The exe is the starting place and it consumes the dll's and config.ini and other resources to run => you have to have all parts in the same directory for the app to run typically called "packaging" an app. E.g. An installer simply ensures that all those files in a packaged app are placed on a users computer in an Windows application directory, and creates a shortcut launch icon so that a user can click the shortcut in the start bar and the app will run.
To "package" your app (put the dll's and exe in the same folder) you can use an Add-In called "Package and Deployment Wizard":
And here is a demo of using it: https://www.youtube.com/watch?v=XT7jaoAiKDo
You can either package and create an installer and package or just create a package:
Now if the Deployment Wizard doesnt show as an add-in on your VB6 Editor Installation, go to editor's program folder and find the tools Tools folder, i.e:
Then you should be able to find the Deployment Wizard there:
Open it to use it.

Resources