Archive: ${DisableX64FSRedirection} brings to crash the installer


${DisableX64FSRedirection} brings to crash the installer
Hi,

I have compiled a installer which I am testing on a x64bit XP SP2 maschine.

But when I want to disable the FSRedirection of XP so that the programm is installed in "program files" and not "program files(x86)" the installer crashes and Visual Studio Debugger wants to start.


Function .onInit
!insertmacro MULTIUSER_INIT
!insertmacro MUI_LANGDLL_DISPLAY


${If} ${RunningX64}
${DisableX64FSRedirection}
strcpy $INSTDIR $PROGRAMFILES
${EndIf}

FunctionEnd


Someone has an idea why that is happening?

What are the details of the crash?


VB.net
Hi,

I attached a pic. It shows that the installer freezes and the VS debugger starts.
It freezes direct after the Welcome screen, when I click on "next"


Did you remember to re-enable the redirection after .onInit?


Hi,

you are right I did not re-enabled but I did not know that it would be nessacary. Beacause the redirection is just off for this thread. Whatever... I have done that now:


${If} ${RunningX64}
${DisableX64FSRedirection}
strcpy $INSTDIR $PROGRAMFILES
${EnableX64FSRedirection} //Added
${EndIf}]



I did not freeze here now
but now the $INSTDIR just redirects to C:\Program Files(x86) :(

I tried to add ${EnableX64FSRedirection} in the Main Section of my installer because at this point (code above) the redirection is enabled to early. In the main section I add some entries to registry and this entries are written in the WOW6432 folder.

In the main section I wrote that:


${EnableX64FSRedirection} //Added before here
SetRegView 64
DeleteRegKey HKLM "SOFTWARE\Program\Addins\{fb43cf20-ef35-48ce-b08e-46f9bd4507ec}"
SetRegView 32
DeleteRegKey HKLM "SOFTWARE\Progam\Addins\{fb43cf20-ef35-48ce-b08e-46f9bd4507ec}"


But here the installer freezed again :(
Any idea what I can do to redirect correctly?

You must always disable redirection immediately after you're done using it for files. What's the complete code now?


Originally posted by kichik
You must always disable redirection immediately after you're done using it for files. What's the complete code now?
Hi,

as i showed in my post before I disable the Redirection after I used it. The installer does not freeze even but the folder redirects to the x86 folder and thats what I excactly not want.
Here the code again


${If} ${RunningX64}
${DisableX64FSRedirection}
'Disabled redirection because I want to redirect to Program Files and not to Program files x86

strcpy $INSTDIR $PROGRAMFILES
${EnableX64FSRedirection} //enabled redirection again
${EndIf}]




This is my whole onInit function:


Function .onInit

${If} ${RunningX64}

${DisableX64FSRedirection}
strcpy $INSTDIR $PROGRAMFILES
${EnableX64FSRedirection}
${EndIf}

!insertmacro MULTIUSER_INIT
!insertmacro MUI_LANGDLL_DISPLAY
!insertmacro INSTALLOPTIONS_EXTRACT "licInfoDlg.ini"
!insertmacro INSTALLOPTIONS_EXTRACT "bit_question.ini"
;!insertmacro INSTALLOPTIONS_EXTRACT "NetInstDlg.ini"



FunctionEnd



I want that on a x64bit the programm is extracet to the Program Files folder not the x86 program files folder.


Why the $PROGRAMFILES links to x86 folder although the redirection is disabled?

Try $PROGRAMFILES64.