tbednarz
26th January 2006 17:01 UTC
Simple question
I have my core application and a tool, which should only be installed, if it is not already there. The tool is 3rd party so I do have two cab files.
Currently I have in my script:
Section "my app" SEC01 ;(required section)
SetOutPath "$INSTDIR"
SectionIn 1, RO
SetOverwrite on
File "myAppFiles\Setup_MyApp.ini"
File "MyAppFiles\MyApp.CAB"
StrCpy $0 "$INSTDIR\Setup_MyApp.ini"
Call InstallCAB
MessageBox MB_OK|MB_ICONINFORMATION \
"Please wait for the myApp application install to finish on your device before continuing."
SectionEnd
No I use RAPI to query the registry of the PPC to find out, if the tool is already installed or not. If it is NOT, I need to add another CAB file and also need to change Setup_MyApp.ini.
Could anybody please explain me, where to do this and how?
Tom
kichik
26th January 2006 18:26 UTC
I don't understand what's the problem. Are you having problems with defining the logic? If so, see the tutorial. Are you have problems using RAPI? If so, see the Wiki page.
tbednarz
26th January 2006 19:42 UTC
Well RAPI is not the problem since thats all in C/C++ which I use as programming language for almost 15 years!
The problem is the script where I still do not see the real program flow. There is no main (entry point), from which you can call functions and define a program flow. Instead there are tons of macros and jumps from one place to another, variables can be defined everywhere and seem to be only of type String. So I do not understand where to do what!
Here the structure of my script which works but I do not understand how!!
- It starts with some defines followed by some includes.
- Then many !insertmacro follow to define the pages shown
- Then there are some ReserveFile for my custom dialogs
- Then follow three sections
- After that the section descriptions!
- Then follows a .onInit function
- Then all functions containing my code for the custom pages
So the program flow cannot be along line numbers, it is magic to me where it starts and when it does what. The documentation describes what a page is, what a section, how variables are declared etc. But I could not find something explaining in which order all those things are processed!
So to install multiple CAB files on a PDA depending on some conditions NOT definable by the user should I :
- define multiple sections, for every cab file one? Then call InstallCAB inside every section? (If so where is defined in which order and when a section is processed? How can I conditionally execute a section? To me there is a lot of magic in many of the samples!)
- Write a separate INI file for every CAB file and put the logic in the myApp section using some ${if} statements and call there InstallCAB?
Many thanks for your help!
Tom
kichik
28th January 2006 10:53 UTC
The program flow is explained in the tutorial. Was it not clear enough? How do you think it can be improved?
How you wish to install multiple CABs is up to you. If you want to give the user the option, you'd want two sections so the user will see two components he can select from. If you want it to be based on some other logic, then yes, you'd need ${If} and friends.