File instlux-x64.patch of Package instlux

diff -Naru instlux-SVN62_orig/instlux/src/instlux_template_en.nsi instlux-SVN62/instlux/src/instlux_template_en.nsi
--- instlux-SVN62_orig/instlux/src/instlux_template_en.nsi	2012-11-22 19:54:26.080293800 +0900
+++ instlux-SVN62/instlux/src/instlux_template_en.nsi	2012-11-22 19:57:05.402287523 +0900
@@ -48,6 +48,10 @@
 
   !include "MUI.nsh"
 
+;Include X64 macro
+
+  !include "x64.nsh"
+
 ;--------------------------------
 ;General
 
@@ -122,7 +126,7 @@
 var idstring
 var pos
 var char
-
+var BcdEdit
 
 Function .onInit
 	# the plugins dir is automatically deleted when the installer exits
@@ -231,13 +235,21 @@
       MessageBox MB_OK "You ($0) have not administrator privileges to complete this operation."
       Quit
     ${Endif}
+
+    ; if running in X64, bcdedit is in %windir%\Sysnative.
+    ${If} ${RunningX64}
+      ExpandEnvStrings $BcdEdit "%windir%\Sysnative\bcdedit"
+    ${Else}
+      StrCpy $BcdEdit "bcdedit"
+    ${EndIf}
+
     ReadRegStr $0 HKLM "Software\DISTRO\DISTRO-Installer Loader" "bootmgr"
     ${If} $0 == ""
-      nsExec::ExecToStack '"bcdedit" /create /d "BOOT_TITLE" /application bootsector'
+      nsExec::ExecToStack '"$BcdEdit" /create /d "BOOT_TITLE" /application bootsector'
       Pop $0
       ${If} $0 != 0
         StrCpy $0 bcdedit.exe
-        MessageBox MB_OK "Cannot exec bcdedit.exe" ; TODO: translate error string!
+        MessageBox MB_OK 'Cannot exec "$BcdEdit"' ; TODO: translate error string!
         Quit
       ${Endif}
       Pop $0 ; "The entry {id} was successfully created"
@@ -261,9 +273,9 @@
     ${Else}
       StrCpy $id $0
     ${Endif}
-    nsExec::Exec '"bcdedit" /set $id device partition=$c'
-    nsExec::Exec '"bcdedit" /set $id path \grldr.mbr'
-    nsExec::Exec '"bcdedit" /displayorder $id /addlast'
+    nsExec::Exec '"$BcdEdit" /set $id device partition=$c'
+    nsExec::Exec '"$BcdEdit" /set $id path \grldr.mbr'
+    nsExec::Exec '"$BcdEdit" /displayorder $id /addlast'
 
     # Container files
     File /oname=$c\grldr "grldr"
@@ -467,13 +479,20 @@
   lbl_WinVista:
      Delete /REBOOTOK "$c\grldr"
 
+     ; if running in X64, bcdedit is in %windir%\Sysnative.
+     ${If} ${RunningX64}
+       ExpandEnvStrings $BcdEdit "%windir%\Sysnative\bcdedit"
+     ${Else}
+       StrCpy $BcdEdit "bcdedit"
+     ${EndIf}
+
      ReadRegStr $0 HKLM "Software\DISTRO\DISTRO-Installer Loader" "bootmgr"
      ${If} $0 != ""
-       nsExec::Exec '"bcdedit" /delete $0'
+       nsExec::Exec '"$BcdEdit" /delete $0'
        Pop $0
        ${If} $0 != 0
          StrCpy $0 bcdedit.exe
-         MessageBox MB_OK "bcdedit /delete $0 failed"; TODO: translate error string!
+         MessageBox MB_OK '"$BcdEdit" /delete $0 failed'; TODO: translate error string!
        ${Endif}
        DeleteRegKey HKLM "Software\DISTRO"
     ${Endif}
openSUSE Build Service is sponsored by