title: DLL's being changed when plugging USB device into computer?
body: <p>I currently have a device utilizing the libusb0.dll file, I use inno script to install the dll's into their respective folders, the 32bit version into the syswow64 and the 64bit version into the system32 since I am using a 64bit pc.</p>
  <p>The problem I am having is that when the device is not plugged in and I run the installer created by inno script it installs the dll's into their correct location, although when I plug in the usb device suddenly the dll's are either modified or are switched. To me it looks as if now the 64bit dll is in the syswow64 and the 32bit dll is in the system32. So basically my exe for the usb device will run when the device is not plugged in but does not work when I plug in the device because the dll's get modified when the device gets plugged in. I am not sure why this is happening.</p>
  <p>The 32bit dll is 66.0kb and the 64bit dll is 74.5kb. Which leads me to believe that the 32bit dll is being replaced with the 64bit dll, not sure if this is exactly what is happening though.</p>
  <p>Before plugging in usb device:</p>
  <p><a href="https://i.stack.imgur.com/vNRXk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vNRXk.png" alt="enter image description here" /></a></p>
  <p>After plugging in usb device:</p>
  <p><a href="https://i.stack.imgur.com/Zzw2o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zzw2o.png" alt="enter image description here" /></a></p>
  <p>I have tested this by manually moving the dll's back to their respective locations and everything works fine, but if I run the installer again, the same thing happens, I plug in the usb device and it fails to work again, I get this error from the exe when trying to open it. which I believe is just telling me that either the dll is missing or in the wrong location.</p>
  <p>How I am putting the dlls into the 2 folders:</p>
  <pre><code>Source: ..\lib_usb_win32\libusb-win32-bin\bin\amd64\{#LibUSB_AMD64_DLL}; DestDir: {sys}; DestName: libusb0.dll; FLags: replacesameversion restartreplace uninsneveruninstall; Check: Is64BitInstallMode
  Source: ..\lib_usb_win32\libusb-win32-bin\bin\x86\{#LibUSB_X86_DLL}; DestDir: {syswow64}; DestName: libusb0.dll; FLags: replacesameversion restartreplace uninsneveruninstall; Check: Is64BitInstallMode
  Source: ..\lib_usb_win32\libusb-win32-bin\bin\x86\{#LibUSB_X86_DLL}; DestDir: {sys}; DestName: libusb0.dll; FLags: replacesameversion restartreplace uninsneveruninstall; Check: &quot;Not Is64BitInstallMode&quot;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/LF4Of.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LF4Of.png" alt="enter image description here" /></a></p>