Solved

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

Posted on 2014-04-05
18
912 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
  • 7
  • 6
  • 3
  • +1
18 Comments
 
LVL 34

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 53

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 51

Expert Comment

by:Joe Winograd, EE MVE
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
 

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 34

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 34

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 34

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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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 34

Accepted Solution

by:
Dan Craciun earned 350 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 53

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 51

Assisted Solution

by:Joe Winograd, EE MVE
Joe Winograd, EE MVE earned 150 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 51

Expert Comment

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

Expert Comment

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

Author Comment

by:shawn857
ID: 39985138
Thank you guys.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

After playing around with my ASUS 1215n (http://www.asus.de/product.aspx?P_ID=HrglRhH8D60Rmlv3) Netbook, I finally managed to get smooth HD 1080p (http://en.wikipedia.org/wiki/1080p) playback of videos on it. Second Generation Intel Atom (http://en.…
Hi Friends, These registry tweaks will help you optimizing your Windows 7 system for any VDI. This will improve the machine performanance and can be used on normal systems also. These are few registry tweaks which will add value by enhancing the …
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now