The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Magnum on February 12, 2011, 02:43:36 AM

Title: Install program
Post by: Magnum on February 12, 2011, 02:43:36 AM
I am interested in learning how to install programs.

Something simple, like copy a program to a directory, inform the user, etc.

If my program doesn't use the registry, do I need to register it?

Title: Re: Install program
Post by: donkey on February 12, 2011, 02:49:00 AM
From the start menu select Run, in the dialog type iExpress, its a useful little install maker with a number of great options. You can also build scripts (inf files) to modify the registry, for versioning and a number of other functions.

Using iExpress technology (http://technet.microsoft.com/en-us/library/dd346760.aspx)
Title: Re: Install program
Post by: jj2007 on February 12, 2011, 04:09:23 AM
Quote from: donkey on February 12, 2011, 02:49:00 AM
From the start menu select Run, in the dialog type iExpress, ...

Very useful hint, thanks Edgar. It reports somewhat hilarious compression ratios ("85%" when the effective size is 120k from 60k sources...) but works just fine and allows a single prompt install.
Title: Re: Install program
Post by: oex on February 12, 2011, 04:17:06 AM
Quote from: jj2007 on February 12, 2011, 04:09:23 AM
It reports somewhat hilarious compression ratios ("85%" when the effective size is 120k from 60k sources...) but works just fine and allows a single prompt install.

A simple Gateometric formular.... :lol

120 + 60=180 / 60 = 3 => 60 / 3 = 20
120 / 60 = 2 => 20 * 2 = 40 + 2 = 42 + 60 = 102 = 85%
Title: Re: Install program
Post by: Magnum on February 12, 2011, 04:56:02 AM
Thanks for the info gentlemen.

At my stage of development, my programs aren't complex.

The executable and a batch file to make a directory and install and uninstall may suffice.

I have some programs now that don't install in C:\Program Files.





Title: Re: Install program
Post by: Vortex on February 12, 2011, 09:36:01 AM
Quote from: Magnum on February 12, 2011, 04:56:02 AM
I have some programs now that don't install in C:\Program Files.

Hi Magnum,

Why not to create a portable application? The user should be able to select the installation directory.
Title: Re: Install program
Post by: Magnum on February 12, 2011, 01:10:37 PM
I will look up how to create a portable app.

I use a portable version of Firefox on my thumbdrive for when I go to the Senior Center.

Title: Re: Install program
Post by: donkey on February 12, 2011, 08:51:32 PM
Quote from: Vortex on February 12, 2011, 09:36:01 AM
Quote from: Magnum on February 12, 2011, 04:56:02 AM
I have some programs now that don't install in C:\Program Files.

Hi Magnum,

Why not to create a portable application? The user should be able to select the installation directory.

Not sure but I think that installing in C:\Program Files now requires an elevation manifest since any writes to that folder actually go to a shadow folder. However, and I can't verify this, if the name of the application is setup.exe the system will assume an elevation manifest and prompt the user for admin privileges. I seem to remember reading that somewhere but I can't find the reference anymore.

Edgar
Title: Re: Install program
Post by: Antariy on February 13, 2011, 02:57:11 AM
Quote from: jj2007 on February 12, 2011, 04:09:23 AM
It reports somewhat hilarious compression ratios ("85%" when the effective size is 120k from 60k sources...) but works just fine and allows a single prompt install.

It uses makecab archiver - this is reason. LZX-21 compression pretty good, and may beat WinRAR and many other archives with some kinds of data.

makecab can be called from a command line - read its "help".

Though, makecab cannot compress directories, and may compress many files only if they are in a file with a "directives".

This is simple example of using makecab with maximal standard LZX:21 compression:


makecab /D CompressionType=LZX /D CompressionMemory=21 SomeFile.Ext

Title: Re: Install program
Post by: Yuri on February 13, 2011, 03:39:20 AM
Quote from: donkey on February 12, 2011, 08:51:32 PM
However, and I can't verify this, if the name of the application is setup.exe the system will assume an elevation manifest and prompt the user for admin privileges. I seem to remember reading that somewhere but I can't find the reference anymore.

Maybe it's here: Inside Windows Vista User Account Control (http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx)
Quote
The vast majority of installation programs require administrative rights, so the image loader, which initiates the launch of an executable, includes installer detection code to identify likely legacy installers. Some of the heuristics it uses are as simple as detecting if the image has the words setup, install, or update in its file name or internal version information; more sophisticated ones involve scanning for byte sequences in the executable that are common to third-party installation wrapper utilities.
Title: Re: Install program
Post by: Magnum on February 13, 2011, 10:33:43 AM
I started looking to see if makecab can be used as a file compressor instead of
relying on outside compressors.

Found some info here.

http://msdn.microsoft.com/en-us/library/ms916839
Title: Re: Install program
Post by: Antariy on February 14, 2011, 12:32:23 AM
Quote from: Magnum on February 13, 2011, 10:33:43 AM
I started looking to see if makecab can be used as a file compressor instead of
relying on outside compressors.

Found some info here.

http://msdn.microsoft.com/en-us/library/ms916839

Interesting article. Though, advise to use zip compression looking strange - MS uses LZX-21 to compress their things (like files in installations of WinNT v <6).

Needed to set CompressionType and CompressionMemory differently from the example - to have a lot better compression:


;*** Sample Source Code MakeCAB Directive file example
;
.OPTION EXPLICIT ; Generate errors
.Set CabinetNameTemplate=Sample.cab   
.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single
  directory
.Set CompressionType=LZX; <---
.Set CompressionMemory=21 ; <---
  files
.Set UniqueFiles="OFF"
.Set Cabinet=on
.Set DiskDirectory1=SAMPLE.CAB
manifest.xml
WebPart1.dwp
SampleWebPartLibrary.dll
Image1.gif
help.htm
.Set DestinationDir=de-DE
de-DE\WebPart1.dwp
de-DE\image1.gif
de-DE\help.htm

Title: Re: Install program
Post by: Magnum on February 14, 2011, 01:49:01 AM
There are links from here to get all the cabinet utilities.

They have one that makes, view, etc. cabinet files.

Just follow the "yellow brick road."

http://support.microsoft.com/kb/310618
Title: Re: Install program
Post by: Magnum on February 14, 2011, 03:08:26 AM
The compression is comparable to Winzip as you can see if you run the bat file.

Now to see if the utility can be redistributed.

The utility was first used when floppies were common.

Title: Re: Install program
Post by: Antariy on February 14, 2011, 03:18:26 AM
tail...
Title: Re: Install program
Post by: Antariy on February 14, 2011, 03:19:04 AM
Quote from: Magnum on February 14, 2011, 03:08:26 AM
The compression is comparable to Winzip as you can see if you run the bat file.

Now to see if the utility can be redistributed.

The utility was first used when floppies were common.

Is not anybody anytime read anything what I've written??? :(

Use *LZX compression* - then WinZip are far away...

Repeat:


makecab /D CompressionType=LZX /D CompressionMemory=21 SomeFile.Ext


Test.bat contents to change:

makecab /D CompressionType=LZX /D CompressionMemory=21 makecab.exe new.cab

Title: Re: Install program
Post by: Magnum on February 14, 2011, 03:31:59 AM
Thanks.

Your way was about 10% smaller.

Can it decompress as well?
Title: Re: Install program
Post by: Antariy on February 14, 2011, 03:38:07 AM
Quote from: Magnum on February 14, 2011, 03:31:59 AM
Thanks.

Your way was about 10% smaller.

Can it decompress as well?

With some kinds of data (like raw images, or documents) it may be better than even WinRAR.

Yes it is decompressible normally by all the programs which support CAB format decompresion.
Title: Re: Install program
Post by: Magnum on February 14, 2011, 03:49:43 AM
I found the answer.

Expand.exe

Since M.S. is consistent, some of the expand command lines don't make sense.  :boohoo:

expand cabbie.cab -r which renames it. ??

Title: Re: Install program
Post by: dedndave on February 14, 2011, 10:07:38 AM
renames expanded files
if you poke around in the I386 cabinet files, that will make more sense to you   :bg
Title: Re: Install program
Post by: Magnum on February 14, 2011, 12:33:08 PM
Thanks, I will put that on my to do list.

I am documenting my ReportEvent code more to find out why it isn't working.

I am doing something wrong in this statement and I believe it is my event identifier.

DWORD dwEventID,   // event identifier

invoke ReportEvent,hEventLog,EVENTLOG_INFORMATION_TYPE,1,02h, 
NULL,1,sizeof string1,addr stringpointers,NULL

For it to work requires a registry entry, a .dll, and a whole lot of luck.  :dazzled:

What makes it hard to fix is that I get the same Error_IO_Pending when:

1. The dll is missing
2. The registry entry isn't there

If someone else would be willing to test it on a non XP Home Edition, I could zip up everything including the .reg file.

Maybe it doesn't work on the Home Edition?