Ways to reduce the size of a Bacic MSI Installer using Installshield - activex

I just made a Basic MSI installer [using installshield 2012 spring professional ] to install an ActiveX control , i basically added the component and enabled "extract com info on installation" option for the key file .
I have hard coded the destination path and disabled the license , company info ,destination path selection dialogs . In the releases under seup.exe i have enabled compression MSZIP .
The size of the ActiveX dll is 200 kb , but the size of the setup.exe file generated is 1.5 Mb , Is there anything that i can do reduce the size further ?

You'd have to look at your MSI in ORCA to see where the bloat is coming from. You might be able to simplify the graphics used for the dialogs or you might find some C++ infrastructure custom actions inserted by InstallShield that you don't need. (Right click show all custom actions)
I just created a Basic MSI using IS2012 taking all the default settings (including MSZIP) and it was 613KB. I then added a arbitrary OCX from the syswow64 folder ( selected based on size: ahtmlle2.ocx 218kb), extracted the COM data and rebuilt. The MSI was 845KB using MSZIP and 809KB using LZX.
I then looked at the Binary table and saw SetAllUsers.dll and ISSELFREG.dll. I don't need either of those so I took them out. That got me down to 438KB.
Finally I looked at the stock bitmaps used in the dialogs. ( NewBinary1 and NewBinary5 in my case. ) Banner (NB1) was 4KB. Dialog (NB5) was 16KB. Not really bloated. Still I turned them into blank white JPG's and rebuilt. That got me to 424KB. There are probably some other things to chase ( icons for dialogs ) but now I decided to try WiX.
I created a WiX MSI using the same JPGs and the size was 392KB. Smaller, but not in any meaningful way. I used this just as a cross check that my IS MSI was reasonably pure.

Related

how to show the files thumbnails like windows explorer in delphi?

I use the TFileListBox control to show lists of files. But I wonder how to show the file thumbnails in the same way that Windows Explorer does?
You should try using the ShellControls components included in Delphi. (Note that David Heffernan sort of mentioned, and TLama made the initial specific suggestion in the first two comments to your question.) They're not installed by default in recent versions, so you'll have to install them yourself.
These instructions are for the version of Delphi you've indicated you're using (Delphi 2010) - they're the same basically for XE/XE2, except they're in the Samples\Delphi\VCL\ShellControls folder instead (and the Start entry contains XE or XE2 instead of 2010, of course).
Use Start->All Programs, navigate to the Embarcadero RAD Studio or Embarcadero Delphi 2010 item, expand it, and choose Demos. It's in the Win32 folder under DelphiWin32\VCLWin32\ShellControls. Open and build the vclshlctrls.dproj first, and then build and install the dclshlctrls.dproj. You'll need to add the folder above to your Project->Options in the search path for the compiler to be able to find them.
To install the components after building the second package, right-click on the project in the 'Project Manager' and choose 'Install' from the popup (context) menu. The 'Project Manager' in the default configuration is the area on the right edge of the screen that displays the files in the project. Remember, you need to build vclshlctrls first, and then install dclshlctrls, which is the design-time package.
You should then find the TShellListView, TShellTreeView, TShellComboBox, and TShellChangeNotifier components on your palette in the Samples category.
.thumb files are ordinary png files, just with a different file suffix.
Knowing this one can display them in a TImage.
First the .thumb extension needs to be registered as new file format.
For this include PngImage in your uses and call this:
MyImage.Picture.RegisterFileFormat('thumb', 'PNG based thumbnails', TPngImage);
Later you can display the thumb file you like like this:
MyImage.Picture.LoadFromFile('d:\Pictures\Pictures.thumb');

Is it possible to convert a .EXE into an ActiveX object?

Convert might be the wrong word, but to save a user having to install something I wondered if a small EXE can be embedded in a web-page (IE only) using ActiveX so it is run when a button is pressed. Obviously a big security hole but is it feasible?
Urgh, just thinking about it makes me die a little inside.
But yes, package up the exe and the activex in a cab file and use the activex to launch the exe.
Info on packaging up ActiveX cab files is here: http://msdn.microsoft.com/en-us/library/aa751974(v=vs.85).aspx
A bit more information on Inf files (specifically the DestDir bit): http://msdn.microsoft.com/en-us/library/aa741215(v=vs.85).aspx
This would allow you to put the exe in a known location (Windows or System) so that you could execute it from the activex control providing permissions were set correctly

how to extract all icons from some exe files and insert them to other exe files using Delphi?

I'm using Delphi.
I want to know how to extract (all) the icons from an exe file and insert them into another, preserving the order and the index of the icons.
I found some samples of Delphi code using Google but the problem is that it doesn't extract them all.
And I've found some compiled programs (exes) that do one or the other but not both.
Why do I need this: because I have to start some exe files (that have those icons) from virtualized applications. And I want to make some external exe files that have the same name and the same icons.
Thank you for your help.
The source is available for Colin Wilson's XN Resource Editor. It should have what you need.
http://www.wilsonc.demon.co.uk/d10resourceeditor.htm
Alternatively you have the Delphi sample 'ResXplor'. If it's not distributed in your version it's also avalaible to download here: http://radstudiodemos.svn.sourceforge.net/viewvc/radstudiodemos/branches/RadStudio_XE/Delphi/VCL/resXplor/
There was a similar question about extracting icons. PrivateExtractIcons gives you access to specific image sizes in an icon resource, but you need to know the sizes ahead of time, and Microsoft warns that this method is not for general use.
There is a working example of extracting the entire icon resource with all of the image sizes on Delphi Praxis. The example has a problem with 256 pixel images, so it would have to be tweaked to account for these.

InstallAware problem with Delphi 2010

I am trying to create an installation disk with InstallAware Express for my Delphi 2010 application. I have selected (checked)
CodeGear Database Express12
CodeGear Visual Component Library 12
for Application Runtime.
When I try to build it, I will get an error message
Error during build: No files matching pattern "C:\Windows\system32\*120.bpl"
The message will go away if I un-check the above runtime but of coz the program will not run.
Can someone please tell me what I am doing wrong?
Also... I have use their scan file button to scan the dependent files base on my application.exe and installaware put a list of files in the $TARGETDIR$, should I leave them there or I am suppose to move them to various folder (e.g. some of the files are from the windows\system32 directory...)
Thanks a lot.
FWIW, one of the great things about Delphi is that you can pretty much install on any system without worry if you turn off the "build with packages" option. This would eliminate the need for these files, and solve your problem, and also make the application more robust against updates and changes. IMO packages are only needed if you are building multi-module applications which are more advanced, and in that case you wouldn't want to be using any Express installer.
You can manually add the files.
To find out which VCL packages your application uses, open the project in the IDE. Use the menu item Project->Build project to rebuild your entire application, and then use Project->Information to view the information dialog. The list of packages actually required by (and therefore needing to be distributed with) your application are listed there.
Where to install them on the destination system depends on why you're using packages in the first place. If you're using runtime packages simply to reduce the download size for your users, and the packages will only be used by this single application, put them in the same folder as your application ($TARGETDIR$). If you're using them because you've got several different applications, and they'll all be installed in different locations but use the same runtime packages, install them in the System32 folder ($SYSDIR$, if I remember correctly).
InnoSetup works fine with runtime packages manually added, btw, especially if you use the excellent (and also free) ISTool IDE. (Not affiliated in any way; just a happy customer.)
Did you have Delphi 2010 installed on this machine? If so, you should see several bpl files under C:\Windows\system32 folder.

How do I make a Delphi control panel applet be non-'legacy'?

I have a Delphi .CPL currently written with Delphi 7 which needs to update settings in HKLM (to be used by a service application) and which must support Vista, Win7 and Server 2008. Currently this can be done by adding a RUNASADMIN value to AppCompatFlags/Layers, using the CPL file as the value name. This causes Windows to ask for elevation for a 'legacy control panel applet'.
I need to find a way to build the CPL in Delphi 2010 without it appearing to be 'legacy' and, if possible, not to require the registry setting or elevation. Adding the usual manifest resource to the DLL/CPL referencing Common-Controls v6 and "requireAdministrator" does not fix the problem: no elevation is requested and HKLM access fails. Both the original and the Delphi 2010 .CPL can be made to run correctly (after elevation) by navigating to the file in SYSWOW64, right-clicking, and running 'as Administrator'.
Later: I have found a succint explanation of why you cannot elevate a DLL in this way in a forum posting here.
I believe you need to use COM elevation. There was a wonderful blog posting on this which appears to have been taken down, but the source code behind the posting is still available on the VCL components website (way back machine link).
Some additional information can be found in the question/answers for: Delphi: Prompt for UAC elevation when needed
I think I have found a better answer to my question. There is such an animal as a 'non-legacy' control panel applet, which is described in MSDN here. "Now, in Windows Vista, you can add your own applet to Control Panel by creating an executable for your applet and registering it, instead of going through the trouble of creating a .cpl file."

Resources