/build/static/layout/Breadcrumb_cap_w.png

FILE REPLACEMENT

Am working on an app that replaces SERVICES file in WINDOWS\SYSTEM32\DRIVER\ETC.
The original app replaces the service file but the resulting msi does not. I've checked my msi and the services file is there but it does not replace the one on destination computer after installation.

Pls help

Giz

0 Comments   [ + ] Show comments

Answers (8)

Posted by: jonasm 18 years ago
Blue Belt
0
Hi!

The file gets replaces "in following order":

1. The new file has a higher version number
2. If the new file as a version number, but the old files does not.
3. If the files has different languages, the one that has the ProductLanguage Propery value will be installed.
4. If the files that don't have version numbers at all, the file with the newest date will be installed.

In InstallShield there is a setting to "always overwrite" on the file. I have not used it myself tho.

I hope this helps.

/Jonas
Posted by: gizmolala 18 years ago
Third Degree Blue Belt
0
tnx jonas. one question, how come the original application replaces the services file but the msi does not though the file exist in the msi.

Giz
Posted by: brenthunter2005 18 years ago
Fifth Degree Brown Belt
0
First of all, you don't want to replace the SERVICES file as you could be overwriting important information. You should really have a custom action that appends the neccessary text to the end of the file. And then on uninstall, it removes the added lines.
Posted by: gizmolala 18 years ago
Third Degree Blue Belt
0
Tnx. It works well on XP but not on Win2000. On Win2000, the services file is not replaced but on XP it renames the original to .bk and then places the other file there.
Just finding a way to resolve this issue with Win2000

Giz
Posted by: timmsie 18 years ago
Fourth Degree Brown Belt
0
I agree with Mr Hunter

Is the original application an msi. If not then it wont follow the file versioning rules and is set to always overwrite, which is dodgy
Posted by: gizmolala 18 years ago
Third Degree Blue Belt
0
The app is actually SAPGUI 6.2. Does not come with any msi. I did setupcapture b4 and after. my resulting msi renames the original services file to services.bk in Win XP but does not do the same in Win2000.

Giz
Posted by: jonasm 18 years ago
Blue Belt
0
Maybe the file you have captured has the same date och version as the one already existing??

I would also recommend you to append the information to your file.

You can use this VBS to append the information, but you have to figure out the other yourself. =)

/Jonas

------------------

On Error Resume Next
Set shell = WScript.CreateObject("WScript.Shell")
Set FSO = WScript.CreateObject("Scripting.FileSystemObject")
'Settings for the paths
WindowsSystemServiceFolder = "C:\WINDOWS\system32\drivers\etc\"
FileToOpen = "services"

'Open files-values
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

Set File = fso.OpenTextFile(WindowsSystemServiceFolder + FileToOpen, ForAppending)
File.WriteLine "Service 1 1111/tcp #Service number 1"
File.WriteLine "Service 2 2222/tcp #Service number 2"
File.WriteLine "And so on..."
File.Close

WScript.Quit
Posted by: gizmolala 18 years ago
Third Degree Blue Belt
0
I really appreciate Jonas.

Giz
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ