?
Solved

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

Posted on 2014-04-05
18
Medium Priority
?
1,107 Views
Last Modified: 2014-04-07
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
Comment
Question by:shawn857
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 3
  • +1
18 Comments
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39980856
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
 
LVL 56

Expert Comment

by:McKnife
ID: 39981081
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
 
LVL 55

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 39981394
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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

Author Comment

by:shawn857
ID: 39982270
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
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39982282
WoW64 means "Windows [32-bit] on Windows 64-bit". It's the way 32 bit applications are run on 64-bit systems.
0
 

Author Comment

by:shawn857
ID: 39982303
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
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39982309
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
 

Author Comment

by:shawn857
ID: 39982331
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
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39982347
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
 

Author Comment

by:shawn857
ID: 39982354
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
 
LVL 35

Accepted Solution

by:
Dan Craciun earned 1400 total points
ID: 39982371
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
 
LVL 56

Expert Comment

by:McKnife
ID: 39982373
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
 
LVL 55

Assisted Solution

by:Joe Winograd, EE MVE 2015&2016
Joe Winograd, EE MVE 2015&2016 earned 600 total points
ID: 39983391
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
 

Author Comment

by:shawn857
ID: 39984791
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
 

Author Closing Comment

by:shawn857
ID: 39985117
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
 
LVL 55

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 39985124
You're welcome. Happy to help. And thanks to you for posting your results. Regards, Joe
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39985132
Glad I could help!
0
 

Author Comment

by:shawn857
ID: 39985138
Thank you guys.
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
Suggested Courses
Course of the Month13 days, 15 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question