Reinstall file on repair
Hi All,
I have an application wherein a file is getting installed on installation and this is overwritten/modified on launching the application. On repair I need to replace this file with the initial clean file that comes by first installation. Since this file is already available it is not gettin replaced. Can someone help me in achieving this - Replace a file even if it is available and is of same version, during repair.
NB: i want only this file to be replaced even on its existence [the rest all has to follow the default rules - reinstall only if existing file is old or not available].
Thanks in advance.
I have an application wherein a file is getting installed on installation and this is overwritten/modified on launching the application. On repair I need to replace this file with the initial clean file that comes by first installation. Since this file is already available it is not gettin replaced. Can someone help me in achieving this - Replace a file even if it is available and is of same version, during repair.
NB: i want only this file to be replaced even on its existence [the rest all has to follow the default rules - reinstall only if existing file is old or not available].
Thanks in advance.
0 Comments
[ + ] Show comments
Answers (8)
Please log in to answer
Posted by:
India_Repackaging
15 years ago
Posted by:
anonymous_9363
15 years ago
Not really, since changing that property would result in all files and registry settings being reinstalled (or not). The OP wants one file to be replaced, irrespective of version etc.
My first thought would be to do this via a scripted Custom Action, conditioned to run only on re-install. Before that, though, I'd be finding out why the application is modifying the file.
My first thought would be to do this via a scripted Custom Action, conditioned to run only on re-install. Before that, though, I'd be finding out why the application is modifying the file.
Posted by:
rayz_0020
15 years ago
Thanks for the replies guys.. Ian, i have used a scripted CA to delete the file(InstallInitialize) during repair. Hope this is wat u meant by
Please let me know if u have meant something else.
Thanks again.
My first thought would be to do this via a scripted Custom Action, conditioned to run only on re-install.
Please let me know if u have meant something else.
Thanks again.
Posted by:
anonymous_9363
15 years ago
Posted by:
Ram
15 years ago
Hi rayz,
I got a different method you could try it.
Copying preference file on per user basis
Step 1
Create a .reg file (name : activesetup.regâ€Â)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components\{123u1231231-12313-123-123}
@="name of the app"
"StubPath"=cmd.exe /c "C:\\Program Files\\folder name\\Active Setup\\activesetup.cmd" "Version"="1,0"
Note: the guid can be any thing unique.
Step 2
Create an .cmd (ex: activesetup.cmd) that actually copies the pref files to the desired location.
xcopy.exe "%PROGRAMFILES%\path to the folder " "%USERPROFILE%\Application Data\name of the folder" /e /v /c /i /h /r /k /y /t
Step 3
In the install.cmd : add the following
regedit.exe /s activesetup.reg
COPY ".prefered file" "%PROGRAMFILES%\location\ActiveSetup\" /Y
COPY "ActiveSetup.cmd" "%PROGRAMFILES%\location\ActiveSetup\" /Y
: Here the Activesetup is a folder that must be created if you wish to place the reg file in that folder.
Thanks,
Ram.
I got a different method you could try it.
Step 1
Step 2
: Here the Activesetup is a folder that must be created if you wish to place the reg file in that folder.
Thanks,
Ram.
Posted by:
AngelD
15 years ago
Posted by:
Inabus
15 years ago
Posted by:
rayz_0020
15 years ago
Yes Ian u r right..
i placed it after InstallInitialize and the app works fine.
Ram, i need the file replacement on every repair (Active Setup - runs only once at the first login). So i am afraid i cannot use it. Thanks for the reply though.
Exactly so, although I'm not sure what your reference to 'InstallInitialize' is about. I presume you mean that you have the CA sequenced after that...?
i placed it after InstallInitialize and the app works fine.
Ram, i need the file replacement on every repair (Active Setup - runs only once at the first login). So i am afraid i cannot use it. Thanks for the reply though.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.