• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1229
  • Last Modified:

My application's installation does not write files to \Windows\System32

Dear Experts, I developed an app (Delphi language) on my Windows XP computer and packaged it up using my installation software ("Install-Us" - now regrettably discontinued). Anyway, testing it on my computers (both XP), everything installs fine, but a user of mine who runs Windows 7 is having big problems - my install package won't install its files to his \Windows\System32 folder. It installs all other files fine, but  files just don't get written to \Windows\System32. I logged into this users computer today to troubleshoot, but since I've never really user Windows 7 before, I'm kind of stumped. I have a feeling it has something to do with "Administrator" stuff or something like that, but I don't know. Would you have any ideas?

Thanks!
    Shawn
0
shawn857
Asked:
shawn857
  • 7
  • 6
  • 3
  • +1
2 Solutions
 
Dan CraciunIT ConsultantCommented:
Right click on the install package, select "Run as administrator".

Or go to Properties->Compatibility->Run this program in compatibility mode with Windows XP.

HTH,
Dan
0
 
McKnifeCommented:
Side note: if you are a developer and you don't know about UAC, you will have a hard time on non-xp systems. So try to adopt to this technology . http://en.wikipedia.org/wiki/User_Account_Control

In short: an administrator on UAC-enabled systems (vista/7/8/8.1, servers from 2008 and onwards) will not be granted administrative rights until he elevates. Writing to system32 requires elevation.
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
Hi Shawn,
I don't know the Install-Us package, but I use an excellent, open source (and free!) installer called the Nullsoft Scriptable Install System (NSIS). It is available for download at SourceForge:
http://sourceforge.net/projects/nsis/

I have used it to create installers that run fine on XP, Vista, W7, and W8 (32-bit and 64-bit). Since your Install-Us software has been discontinued, you may want to consider NSIS as an alternative install system for your Delphi executables.

To follow-up on Dan's and McKnife's comments, here's the NSIS statement to require admin rights on Vista/W7/W8 when UAC is enabled (this is the first line of code in all of my NSIS installers):

RequestExecutionLevel admin

Here's a link to the source code for a simple NSIS installer that handles UAC and installs a Start menu shortcut, as well as an uninstaller:
http://nsis.sourceforge.net/A_simple_installer_with_start_menu_shortcut_and_uninstaller

I used it as a staring point for several installers — it works very well. Regards, Joe
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
shawn857Author Commented:
New development guys - I just discovered today what's going on.... my installation program IS writing the system files after all, but it's writing them to a folder called \Windows\sysWOW64. Funny thing is though, there is also a \Windows\System32 folder, but my files get put in the wrong place. Now I'm an old school guy and I've never used a 64-bit computer before, so I have no idea what this sysWOW64 folder is all about. But I guess my problem is how to get my installation software (or NSIS as suggested by Joe Winograd) to write my installation files to \Windows\System32 on a 64-bit machine.

Thanks!
    Shawn
0
 
Dan CraciunIT ConsultantCommented:
WoW64 means "Windows [32-bit] on Windows 64-bit". It's the way 32 bit applications are run on 64-bit systems.
0
 
shawn857Author Commented:
Thanks Dan... I guess my problem now then is, what do I do about my installation program so it will work for both 32-bit and 64-bit. I have several files that need to be written to \Windows\System32 (for 32 bit computers), so I don't really now what to do for 64-bit machines. Is there no way for an installtion program to write toSystem32 on a 64-bit machine, or will my files always get written to sysWOW64 by default? Sorry for the dumb questions, but I'm a total newbie when it comes to 64-bit.

Thanks
    Shawn
0
 
Dan CraciunIT ConsultantCommented:
Can I ask why they need to be written on \Windows\System32?

Can't you simply write them in the your application install folder and add that folder to the PATH variable?
0
 
shawn857Author Commented:
Well, for one, I use a security module to protect my software from hacking/cracking and the manufacturer explicity says it must be installed to the user's Windows\System32 folder and registered there with regsvr32.exe. I don't know if it could be installed to the application installation folder....

Cheers
   Shawn
0
 
Dan CraciunIT ConsultantCommented:
Then I'm afraid you have a problem.

Even after you will manage to copy the files in the System32 folder,
regsvr32 c:\windows\system32\yourdll.dll
will fail, because you will be running the 64 bit version of regsvr32.

See here: http://support.microsoft.com/kb/282747

I would contact the manufacturer of the security module to get an update that is designed to work on 64-bit systems.

If you cannot do that, inform your customer that your application can only run on a 32-bit system.
0
 
shawn857Author Commented:
Dan, if I install that file (it's an OCX file actually) to my application's installation folder on the 64-bit computer, as you suggest, can I still run regsvr32.exe on it to register it? (or whatever I need to run on it to make it registered...)

Thanks
   Shawn
0
 
Dan CraciunIT ConsultantCommented:
Per the link I posted, you can register 32 bit dll/ocx/whatever using the 32 bit regsvr32, which can be found in \windows\sysWOW64

So something like this should work:
C:\windows\syswow64\regsvr32.exe X:\path\to\yourfile.ocx
0
 
McKnifeCommented:
Shawn, as this will not be your last contact with x64 systems, you should really not (only) use a forum to learn about x64. You would run into other problems pretty soon, I guess.
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
Shawn,
Google "wow64" and you'll learn as much as you want. The Wikipedia article isn't a bad place to start:
http://en.wikipedia.org/wiki/WoW64

The MSDN article is another good read:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa384249%28v=vs.85%29.aspx

The File System Redirector section at the MSDN article talks specifically about SysWOW64:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa384187%28v=vs.85%29.aspx

As I mentioned earlier, I don't know the Install-Us package, but you should be able to use it to determine if you're on a 32-bit or 64-bit system and write to SysWOW64 or System32, accordingly. But, as the other experts have mentioned, the SysWOW64-System32 issue is not the only 64-bit issue. Regards, Joe
0
 
shawn857Author Commented:
yep you're right guys - I do need to learn more about 64 bit, no doubt about it. Dan, I think you're right - I think my Install-Us program is intelligent enough to know that the sysWOW64 folder is where it needs to write those files,  for a 64-bit machine. And if the 32 bit regsvr32.exe is resident there in ssWOW64 and can register the files, then I should be okay. I don't have a 64-bit machine to test on, but I can arrange to sign in to one of my users who does, to try a test. I've modified my project to write most of my files to the application's folder, but still a few need to get written to sysWOW64 (ie. the equivalent of System32 on a 64 bit machine). I think I should be able to get this working - I will get back to you after my test. Thanks for the help.

Shawn
0
 
shawn857Author Commented:
Thank you guys. My test worked and my "System32" files got written to sysWOW64 by default on the 64 bit machine. Any files that didn't NEED to go in sysWOW64, I installed to the application installation folder. I think I'll be alright....

Thanks!
   Shawn
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
You're welcome. Happy to help. And thanks to you for posting your results. Regards, Joe
0
 
Dan CraciunIT ConsultantCommented:
Glad I could help!
0
 
shawn857Author Commented:
Thank you guys.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 7
  • 6
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now