Not all steps get executed
-
PetriSuominen
- Posts: 21
- Joined: Mon Nov 05, 2012 12:40 am
Not all steps get executed
Hi,
I have an install program, that has two separate features. In feature B, the installer is supposed to write some registry keys and create some directories, all these steps are within the same IF-END IF block in the MSICode, ie:
Get Component FeatureB into Variable SELECTED
include script:setupsql2008_x64
Write Registry Key HKLM\SOFTWARE\MyVendorename\SettingA\,
<additional registry writes for various other keys>
Create Folder $DBTARGETDIR$DATA Create Folder $DBTARGETDIR$BACKUP set read write permissions on file system object "$DBTARGETDIR$DATA\" for Everyone
set read write permissions on file system object "$DBTARGETDIR$BACKUP\" for Everyone
end
What happens is weird and I fail to understand why this happens. When I run the installer, it does install the SQL Server 2008 express correctly, it does create the folders, but it does not create the registry keys or set the folder permissions. How can this be since they all are within the same IF-END block ? It cannot be because the execution somehow exits the block premateryly, as the order is such that the registry keys whouls be created between the two steps that do get executed.
Any help would be greatly appreciated !
br,
Petri
I have an install program, that has two separate features. In feature B, the installer is supposed to write some registry keys and create some directories, all these steps are within the same IF-END IF block in the MSICode, ie:
Get Component FeatureB into Variable SELECTED
include script:setupsql2008_x64
Write Registry Key HKLM\SOFTWARE\MyVendorename\SettingA\,
<additional registry writes for various other keys>
Create Folder $DBTARGETDIR$DATA Create Folder $DBTARGETDIR$BACKUP set read write permissions on file system object "$DBTARGETDIR$DATA\" for Everyone
set read write permissions on file system object "$DBTARGETDIR$BACKUP\" for Everyone
end
What happens is weird and I fail to understand why this happens. When I run the installer, it does install the SQL Server 2008 express correctly, it does create the folders, but it does not create the registry keys or set the folder permissions. How can this be since they all are within the same IF-END block ? It cannot be because the execution somehow exits the block premateryly, as the order is such that the registry keys whouls be created between the two steps that do get executed.
Any help would be greatly appreciated !
br,
Petri
Re: Not all steps get executed
Petri,
I have one very quick suggestion which'll take only a moment for you to test: presuming you're running one the later versions of IA, can you try setting the native engine to true and then set it false after the statements that create the folder and write to the registry?
Does it make a difference?
I have one very quick suggestion which'll take only a moment for you to test: presuming you're running one the later versions of IA, can you try setting the native engine to true and then set it false after the statements that create the folder and write to the registry?
Does it make a difference?
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
InstallAware MVP
-
PetriSuominen
- Posts: 21
- Joined: Mon Nov 05, 2012 12:40 am
Re: Not all steps get executed
Hi, and thanks for your reply !
I'm not sure I understand what you mean by Native Engine set to true/false ?
I'm using the IA NX
This is supposed to be a 64bit installer.
I'm not sure I understand what you mean by Native Engine set to true/false ?
I'm using the IA NX
This is supposed to be a 64bit installer.
Re: Not all steps get executed
Petri,
Just before your statements add SET NATIVE_ENGINE TRUE
and after the statements set it back to FALSE.
If you've not heard about the native engine before, open IA then F1 to launch the help and the locate the entry describing the pre-defined variables. You'll see it mentioned in there.
Just before your statements add SET NATIVE_ENGINE TRUE
and after the statements set it back to FALSE.
If you've not heard about the native engine before, open IA then F1 to launch the help and the locate the entry describing the pre-defined variables. You'll see it mentioned in there.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
InstallAware MVP
-
PetriSuominen
- Posts: 21
- Joined: Mon Nov 05, 2012 12:40 am
Re: Not all steps get executed
I tried that, but had the same outcome.
Are there any "usual" pitfalls in using the Write Registry or Grant Access commands, such as UAC virtualization.
The installer does ask for elevated priviledges, so I would assume that UAC virtualization should not be an issue...
br,
Petri
Are there any "usual" pitfalls in using the Write Registry or Grant Access commands, such as UAC virtualization.
The installer does ask for elevated priviledges, so I would assume that UAC virtualization should not be an issue...
br,
Petri
-
PetriSuominen
- Posts: 21
- Joined: Mon Nov 05, 2012 12:40 am
Re: Not all steps get executed
I was also able to confirm, that this is not an UAC issue. If I turn of the UAC all together, it still does not write to the registry.
So far I've tried the NATIVE flag, I tried moving the entire block after the Apply install step. But neither of these worked. It simply does not write to registry...
So far I've tried the NATIVE flag, I tried moving the entire block after the Apply install step. But neither of these worked. It simply does not write to registry...
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Not all steps get executed
Dear Petri,
could you post a very simple project that replicate the issue?
I will have a look.
Regards
could you post a very simple project that replicate the issue?
I will have a look.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
PetriSuominen
- Posts: 21
- Joined: Mon Nov 05, 2012 12:40 am
Re: Not all steps get executed
Hi FrancescoT
I think I made some advance here.
It appears, that the Installer writes these registry keys to HKLM/SOFTWARE/Wow6432node/ ...
Then I also noticed, that for some reason the installer wants to put the executables in Program Files (x86) instead of Program Files.
So for some reason the installer is behaving like a 32 bit installer in 64 bit environment, that is possibly the root cause for these issues.
Although I suppose that doesn't explain why the installer is unable to grant correct access rights to the database directories, but this needs to be worked out one issue at a time.
Can you suggest to me, how to direct the installer to behave correctly (ie. Put stuff in Program Files, not Porgram Files (x86) and not to write these keys in the Wow6432Node) ?
br,
Petri
I think I made some advance here.
It appears, that the Installer writes these registry keys to HKLM/SOFTWARE/Wow6432node/ ...
Then I also noticed, that for some reason the installer wants to put the executables in Program Files (x86) instead of Program Files.
So for some reason the installer is behaving like a 32 bit installer in 64 bit environment, that is possibly the root cause for these issues.
Although I suppose that doesn't explain why the installer is unable to grant correct access rights to the database directories, but this needs to be worked out one issue at a time.
Can you suggest to me, how to direct the installer to behave correctly (ie. Put stuff in Program Files, not Porgram Files (x86) and not to write these keys in the Wow6432Node) ?
br,
Petri
-
PetriSuominen
- Posts: 21
- Joined: Mon Nov 05, 2012 12:40 am
Re: Not all steps get executed
And yes, I do have the Set x64 on the top of the MSIScript 
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Not all steps get executed
Happy that you solved
!
Regards
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
PetriSuominen
- Posts: 21
- Joined: Mon Nov 05, 2012 12:40 am
Re: Not all steps get executed
Oh no I didn't solve anything yet, just thought I made an advancement !
For some reason although I have the Set x64 on top of the MSIscript sequence, It still wants to put executables into Pragram Files (x86) etc...
How do I fix that ?
My Installer is supposed to be 64 bit only, no mixed 32/64 bit environments !
For some reason although I have the Set x64 on top of the MSIscript sequence, It still wants to put executables into Pragram Files (x86) etc...
How do I fix that ?
My Installer is supposed to be 64 bit only, no mixed 32/64 bit environments !
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Not all steps get executed
Dear Petri,
Please have a look at the following topic wich includes a ready to use sample for hybrid 32 64 instllation.
http://www.installaware.com/forum/viewt ... f=2&t=8492
The sample can be used as starting point even in your case where you need to target to x64 platforms only.
In addition, InstallAware comes with a sample template for Win64 projects.
Let me know if helps you.
Regards
Please have a look at the following topic wich includes a ready to use sample for hybrid 32 64 instllation.
http://www.installaware.com/forum/viewt ... f=2&t=8492
The sample can be used as starting point even in your case where you need to target to x64 platforms only.
In addition, InstallAware comes with a sample template for Win64 projects.
Let me know if helps you.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
PetriSuominen
- Posts: 21
- Joined: Mon Nov 05, 2012 12:40 am
Re: Not all steps get executed
Hi,
Actually I was able to figure (most) of it out.
The root cause of the problem was: I call the prequisite check scripts as well as the prequisite install scripts provided by IA.
The issue was, that all of these scripts exit with the last command being Set Win32. So My Set x64 being before these scripts, left the installer in 32-bit mode although I thought it was in 64 bit mode.
As a suggestion for making IA even better than it already is, Could you tweak the scripts in a way that they always exit in the same installer mode as they were entered ? Or perhaps simply document this behaviour in a FAQ or something
I will of course no longer stumble on this particular pitfall 
Now I'm left with only one more problem, perhaps you could help with that one.
My Installer creates a directory for SQL 2008 Express database to reside in. It is put into C:/ProgramData/MyCompany/DB/DATA folder. Now I would prefer not to give everyone full control in this directory, but rather just NT AUTHORITY/NETWORK SERVICE. I do not know what to write into the Set Access Control dialog "Specific User Name/Group" to accomplish this. I've tried all of the following with no luck
- NT AUTHORITY/NETWORK SERVICE
- "NT AUTHORITY/NETWORK SERVICE"
- "NETWORK SERVICE"
- NETWORK SERVICE
None of them work, no rights get assigned. What I have in MSIScript is to first purge all the rights, and then to assign the rights I want to give. I call the Set Access line after the Apply Install. If I simply put there Everyone with Read Write access it works, but this one doesn't
Thanks !
Petri
Actually I was able to figure (most) of it out.
The root cause of the problem was: I call the prequisite check scripts as well as the prequisite install scripts provided by IA.
The issue was, that all of these scripts exit with the last command being Set Win32. So My Set x64 being before these scripts, left the installer in 32-bit mode although I thought it was in 64 bit mode.
As a suggestion for making IA even better than it already is, Could you tweak the scripts in a way that they always exit in the same installer mode as they were entered ? Or perhaps simply document this behaviour in a FAQ or something
Now I'm left with only one more problem, perhaps you could help with that one.
My Installer creates a directory for SQL 2008 Express database to reside in. It is put into C:/ProgramData/MyCompany/DB/DATA folder. Now I would prefer not to give everyone full control in this directory, but rather just NT AUTHORITY/NETWORK SERVICE. I do not know what to write into the Set Access Control dialog "Specific User Name/Group" to accomplish this. I've tried all of the following with no luck
- NT AUTHORITY/NETWORK SERVICE
- "NT AUTHORITY/NETWORK SERVICE"
- "NETWORK SERVICE"
- NETWORK SERVICE
None of them work, no rights get assigned. What I have in MSIScript is to first purge all the rights, and then to assign the rights I want to give. I call the Set Access line after the Apply Install. If I simply put there Everyone with Read Write access it works, but this one doesn't
Thanks !
Petri
-
FrancescoT
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Not all steps get executed
Dear Petri,
The Set Native statement should be placed within the Define Global region of the script, that it is after any Runtime script execution.
Unfortunately, it is not possible to instruct the scripts to exits in the same installer mode as it entered but I will take in account your suggestion about FAQ documentation.
Regarding your accessing permission issue, honestly I never tried to assign that particular one but with any other I used worked fine.
One question, have you checked the control "Set Chosen Users with Access Rights" when entering the User Accounts/Groups parameter?
Let me know.
Regards
The Set Native statement should be placed within the Define Global region of the script, that it is after any Runtime script execution.
Unfortunately, it is not possible to instruct the scripts to exits in the same installer mode as it entered but I will take in account your suggestion about FAQ documentation.
Regarding your accessing permission issue, honestly I never tried to assign that particular one but with any other I used worked fine.
One question, have you checked the control "Set Chosen Users with Access Rights" when entering the User Accounts/Groups parameter?
Let me know.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
-
PetriSuominen
- Posts: 21
- Joined: Mon Nov 05, 2012 12:40 am
Re: Not all steps get executed
Couldn't make the NETWORK USER to work, but that is not mission critical.
Thanks for your help !
Petri
Thanks for your help !
Petri

