Archive: CAb installation


CAb installation
Hi,

I have created an installer for PocketPC. The exe will install from a cab file or more( depends on user selection) using ActiveSync. Right now, it will call the Ceappmgr.exe more than once if user selected more than one components.

My question, is it possible to just call the Ceappmgr just once and then it will install based on the user selection?

Can this function be called just once?

Function InstallCAB

ExecWait '"$1" "$0"'

FunctionEnd


Thank you.


You could call it in a dummy section which is after all other sections.

Section -InstallCAB
ExecWait '"$1" "$0"'
SectionEnd


The - makes it hidden.

Stu

Hi Stu,

Thanks for the reply. I just got back to work on nsis project(before this need to handle other project).

I've tried your suggestion by making the InstallCab hidden. But I didn't see any difference?? I also include both InstallCab section and function in the script, but that still doesn't change anything. :hang:

BTW, why do you change it to Section?

Just FYI, my setup include 3 diff cab file. Each one need to be selected if the user want to install it. So, currently, it's calling the ceappmgr 3 times if all cabb file selected during the installation.


Oh I see what you mean now.
If Ceappmgr allows multiple cab files to be passed on the parameter you could build a string in each section and then execute it in the last.

E.g.


Var CAB1
Var CAB2
Var CAB3

Section 1
StrCpy $CAB1 ' "whatever1.cab"'
SectionEnd

Section 2
StrCpy $CAB2 ' "whatever2.cab"'
SectionEnd

Section 3
StrCpy $CAB3 ' "whatever3.cab"'
SectionEnd

Section -InstallCAB
ExecWait '"Ceappmgr"$CAB1$CAB2$CAB3'
SectionEnd


Stu

Hi, I've tried your code but it doesn't work because CeAppMgr does not allow more than 1 parameters. So I changed it to below:


Section -InstallCAB
;ExecWait '"Ceappmgr" "$CAB1"'
;ExecWait '"Ceappmgr" "$CAB2"'
;ExecWait '"Ceappmgr" "$CAB3"'
SectionEnd


BTW, one more question. How do I include a specific .ini file(that will install a diff cab file) based on component selection? For example,

Case:
There are 3 (A,B,C) components in components page.
If user select
a)just A, installer will use a.ini file.
b)just B, installer will use b.ini file.
c)A and B, installer will use AB.ini file
.....and so on until ABC.ini file.

Is it possible to do it? Where do I put the checking conditions for the case above? .onSelChange or in the sections?

Thank you.

You can check the select state of sections in sections yes. Use the SectionFlagIsSet macro in Sections.nsh (many examples of this on this forum) or use ${SectionIsSelected} with LogicLib.nsh

Stu