![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | VS2005 Setup Project File with Property 'Permanent' is uninstalled Hi, I'm working with VS2005 and I have a setup project that installs a Windows forms application. I have a config file ( it's the app.config file - MyApp.exe.config) which I want to leave on the target system if the application is uninstalled. In the Setup Project File System designer I set the "permanent" property of this file to "True", which should leave the file installed if the user uninstalls the application. However if I uninstall the application using the setup.exe generated by the setup project it removes this file. Am I doing something wrong? |
My System Specs![]() |
| | #2 (permalink) |
| | RE: VS2005 Setup Project File with Property 'Permanent' is uninstalled Hi flutophilus, From your description, I understand you've built a setup project which set a certain file to "permanent = true" so as to prevent it from being removed at uninstall time, however, you found the file still got removed, correct? I agree that the "permanent=true" should keep the file from being removed as you expected. I've also performed some simple tests by creating some setup project and set some files(deploy to program files or desktop folder) to "permanent =true", and they're preserved as expected after I uninstall the program. Therefore, I think this should be a specific case. Have you tried a simple setup (or try mark other files to permanent) to see whether you can get the expected behavior. Also, is there other custom code module in setup project that may touch the file? Sincerely, Steven Cheng Microsoft MSDN Online Support Lead This posting is provided "AS IS" with no warranties, and confers no rights. -------------------- Quote: >From: =?Utf-8?B?Zmx1dG9waGlsdXM=?= <flutophilus@xxxxxx> >Subject: VS2005 Setup Project File with Property 'Permanent' is uninstalled >Date: Wed, 5 Mar 2008 07:39:05 -0800 Quote: > >Hi, > >I'm working with VS2005 and I have a setup project that installs a Windows >forms application. I have a config file ( it's the app.config file - >MyApp.exe.config) which I want to leave on the target system if the >application is uninstalled. In the Setup Project File System designer I Quote: >the "permanent" property of this file to "True", which should leave the Quote: >installed if the user uninstalls the application. However if I uninstall Quote: >application using the setup.exe generated by the setup project it removes >this file. > >Am I doing something wrong? > > |
My System Specs![]() |
| | #3 (permalink) |
| | RE: VS2005 Setup Project File with Property 'Permanent' is uninsta Hi Steven, I created a test project as you suggested and it worked fine. I did wonder if the problem was becuase the file I was marking permanent was the config file (MyApp.exe.config) which is, I realised already included as part of the primary output from the main project. But it worked OK on this file, which is great. So I went back to my original project and removed and re-added the primary output and the config file separately, marked the coinfig file as permanent and to my great pleasure it worked !!! So I have no idea why it failed to wrok before. Now when I uninstal it leaves the config file behind. Interestingly if I re-instal into the same location it does not overwrite the config file. This is great but is it the expected behaviour ? Can I rely on it? Cheers ""Steven Cheng"" wrote: Quote: > Hi flutophilus, > > From your description, I understand you've built a setup project which set > a certain file to "permanent = true" so as to prevent it from being removed > at uninstall time, however, you found the file still got removed, correct? > > I agree that the "permanent=true" should keep the file from being removed > as you expected. I've also performed some simple tests by creating some > setup project and set some files(deploy to program files or desktop folder) > to "permanent =true", and they're preserved as expected after I uninstall > the program. Therefore, I think this should be a specific case. Have you > tried a simple setup (or try mark other files to permanent) to see whether > you can get the expected behavior. Also, is there other custom code module > in setup project that may touch the file? > > Sincerely, > > Steven Cheng > > Microsoft MSDN Online Support Lead > > > This posting is provided "AS IS" with no warranties, and confers no rights. > > > -------------------- Quote: > >From: =?Utf-8?B?Zmx1dG9waGlsdXM=?= <flutophilus@xxxxxx> > >Subject: VS2005 Setup Project File with Property 'Permanent' is uninstalled > >Date: Wed, 5 Mar 2008 07:39:05 -0800 Quote: > > > >Hi, > > > >I'm working with VS2005 and I have a setup project that installs a Windows > >forms application. I have a config file ( it's the app.config file - > >MyApp.exe.config) which I want to leave on the target system if the > >application is uninstalled. In the Setup Project File System designer I Quote: > >the "permanent" property of this file to "True", which should leave the Quote: > >installed if the user uninstalls the application. However if I uninstall Quote: > >application using the setup.exe generated by the setup project it removes > >this file. > > > >Am I doing something wrong? > > > > > |
My System Specs![]() |
| | #4 (permalink) |
| | RE: VS2005 Setup Project File with Property 'Permanent' is uninsta Thanks for your reply, Yes, actually in my test, I explicitly include all the files(of the certain project into my setup project) so that I can set the "permanent" property for the config file. I think you can rely on it (since the "permanent" property is expected to behave like this). However, I suggest you explicitly include the config file into your setup project and set its permanent property. Sincerely, Steven Cheng Microsoft MSDN Online Support Lead Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg@xxxxxx. This posting is provided "AS IS" with no warranties, and confers no rights. -------------------- Quote: >From: =?Utf-8?B?Zmx1dG9waGlsdXM=?= <flutophilus@xxxxxx> >References: <4EB8D294-DC8E-4411-B4DC-DA2C8D859E48@xxxxxx> Quote: >Subject: RE: VS2005 Setup Project File with Property 'Permanent' is uninsta >Date: Thu, 6 Mar 2008 03:44:01 -0800 Quote: > >Hi Steven, > >I created a test project as you suggested and it worked fine. I did wonder >if the problem was becuase the file I was marking permanent was the config >file (MyApp.exe.config) which is, I realised already included as part of Quote: >primary output from the main project. But it worked OK on this file, which Quote: >great. > >So I went back to my original project and removed and re-added the primary >output and the config file separately, marked the coinfig file as Quote: >and to my great pleasure it worked !!! So I have no idea why it failed to >wrok before. > >Now when I uninstal it leaves the config file behind. > >Interestingly if I re-instal into the same location it does not overwrite >the config file. This is great but is it the expected behaviour ? Can I Quote: >on it? > >Cheers > > > >""Steven Cheng"" wrote: > Quote: >> Hi flutophilus, >> >> From your description, I understand you've built a setup project which Quote: Quote: >> a certain file to "permanent = true" so as to prevent it from being Quote: Quote: >> at uninstall time, however, you found the file still got removed, Quote: Quote: >> >> I agree that the "permanent=true" should keep the file from being Quote: Quote: >> as you expected. I've also performed some simple tests by creating some >> setup project and set some files(deploy to program files or desktop Quote: Quote: >> to "permanent =true", and they're preserved as expected after I Quote: Quote: >> the program. Therefore, I think this should be a specific case. Have Quote: Quote: >> tried a simple setup (or try mark other files to permanent) to see Quote: Quote: >> you can get the expected behavior. Also, is there other custom code Quote: Quote: >> in setup project that may touch the file? >> >> Sincerely, >> >> Steven Cheng >> >> Microsoft MSDN Online Support Lead >> >> >> This posting is provided "AS IS" with no warranties, and confers no Quote: Quote: >> >> >> -------------------- Quote: >> >From: =?Utf-8?B?Zmx1dG9waGlsdXM=?= <flutophilus@xxxxxx> >> >Subject: VS2005 Setup Project File with Property 'Permanent' is Quote: Quote: Quote: >> >Date: Wed, 5 Mar 2008 07:39:05 -0800 Quote: >> > >> >Hi, >> > >> >I'm working with VS2005 and I have a setup project that installs a Quote: Quote: Quote: >> >forms application. I have a config file ( it's the app.config file - >> >MyApp.exe.config) which I want to leave on the target system if the >> >application is uninstalled. In the Setup Project File System designer I Quote: >> >the "permanent" property of this file to "True", which should leave the Quote: >> >installed if the user uninstalls the application. However if I Quote: Quote: >> the Quote: >> >application using the setup.exe generated by the setup project it Quote: Quote: Quote: >> >this file. >> > >> >Am I doing something wrong? >> > >> > >> |
My System Specs![]() |
| | #5 (permalink) |
| | RE: VS2005 Setup Project File with Property 'Permanent' is uninsta For completenes, another way to save a config file is to use a custom installer class, here's my effort, fwiw. ' Custom action to run in setup at instal time. Create install log and copy the saved config file to live ' (prevents overwrite of user settings by test settings after first install). ' To run this automatically just put the primary output for this project under the "custom action - install" tag ' in the setup project Public Overrides Sub Install(ByVal stateSaver As System.Collections.IDictionary) ' Uses reflection to find the location of the config file. Dim Asm As System.Reflection.Assembly = _ System.Reflection.Assembly.GetExecutingAssembly ' Asm.Location is location and name of .exe in the installation folder Dim strExeLoc As String = Asm.Location ' the name of the install-to folder Dim strInstallFolder As String strInstallFolder = strExeLoc ' strip out name of executable strInstallFolder = strInstallFolder.Remove(strInstallFolder.LastIndexOf("\"), Len(strInstallFolder) - _ strInstallFolder.LastIndexOf("\")) Dim installlog As New System.IO.StreamWriter(strInstallFolder & "\Installation.log") installlog.AutoFlush = True Try installlog.WriteLine("Starting installation of the config file") installlog.WriteLine("Install folder: " & strInstallFolder) Dim strSavedConfigLoc As String = _ strExeLoc & ".config.saved" ' derive the name of the saved config installlog.WriteLine("Location of the saved config file: " & strSavedConfigLoc) Dim FileInfo As System.IO.FileInfo = New System.IO.FileInfo(strSavedConfigLoc) If Not FileInfo.Exists Then installlog.WriteLine("No saved config file: " & strSavedConfigLoc) installlog.WriteLine("Config will be installed using test settings from setup ") Else Dim strLiveConfigLoc As String = _ strExeLoc & ".config" ' derive the name of the saved config System.IO.File.Delete(strLiveConfigLoc) System.IO.File.Copy(strSavedConfigLoc, strLiveConfigLoc) installlog.WriteLine("Config file copied from: " & strSavedConfigLoc & " to: " & strLiveConfigLoc) End If Finally installlog.WriteLine("Ending installation") installlog.Close() End Try End Sub 'Custom action to run in setup - log the uninstall and save the config file ' To run this automatically just put the primary output for this project under the "custom action - install" tag ' in the setup project Public Overrides Sub UnInstall(ByVal stateSaver As System.Collections.IDictionary) ' Uses reflection to find the location of the config file. Dim Asm As System.Reflection.Assembly = _ System.Reflection.Assembly.GetExecutingAssembly ' Asm.Location is location and name of .exe in the installation folder Dim strExeLoc As String = Asm.Location ' the name of the install-to folder Dim strInstallFolder As String strInstallFolder = strExeLoc ' strip out name of executable strInstallFolder = strInstallFolder.Remove(strInstallFolder.LastIndexOf("\"), Len(strInstallFolder) - _ strInstallFolder.LastIndexOf("\")) Dim installlog As New System.IO.StreamWriter(strInstallFolder & "\Installation.log") installlog.AutoFlush = True Try installlog.WriteLine("Starting uninstallation of the config file") installlog.WriteLine("Install folder: " & strInstallFolder) Dim strLiveConfigLoc As String = _ strExeLoc & ".config" ' derive the name of the config installlog.WriteLine("Location of the config file: " & strLiveConfigLoc) Dim FileInfo As System.IO.FileInfo = New System.IO.FileInfo(strLiveConfigLoc) If Not FileInfo.Exists Then installlog.WriteLine("No live config file: " & strLiveConfigLoc) installlog.WriteLine("Config will not be saved ") Else Dim strSavedConfigLoc As String = _ strExeLoc & ".config.saved" ' derive the name of the saved config System.IO.File.Delete(strSavedConfigLoc) System.IO.File.Copy(strLiveConfigLoc, strSavedConfigLoc) installlog.WriteLine("Config file copied from: " & strLiveConfigLoc & " to: " & strSavedConfigLoc) End If Finally installlog.WriteLine("Ending uninstallation") installlog.Close() End Try End Sub |
My System Specs![]() |
| | #6 (permalink) |
| | RE: VS2005 Setup Project File with Property 'Permanent' is uninsta Is it possible the file was installed with a setup where you had marked it as not being permanent, but then ran your new installer to try and uninstall it? If this is the case, the permanancy of the file had already been set. This would explain why your later new build worked. "flutophilus" wrote: Quote: > Hi Steven, > > I created a test project as you suggested and it worked fine. I did wonder > if the problem was becuase the file I was marking permanent was the config > file (MyApp.exe.config) which is, I realised already included as part of the > primary output from the main project. But it worked OK on this file, which is > great. > > So I went back to my original project and removed and re-added the primary > output and the config file separately, marked the coinfig file as permanent > and to my great pleasure it worked !!! So I have no idea why it failed to > wrok before. > > Now when I uninstal it leaves the config file behind. > > Interestingly if I re-instal into the same location it does not overwrite > the config file. This is great but is it the expected behaviour ? Can I rely > on it? > > Cheers > > > > ""Steven Cheng"" wrote: > Quote: > > Hi flutophilus, > > > > From your description, I understand you've built a setup project which set > > a certain file to "permanent = true" so as to prevent it from being removed > > at uninstall time, however, you found the file still got removed, correct? > > > > I agree that the "permanent=true" should keep the file from being removed > > as you expected. I've also performed some simple tests by creating some > > setup project and set some files(deploy to program files or desktop folder) > > to "permanent =true", and they're preserved as expected after I uninstall > > the program. Therefore, I think this should be a specific case. Have you > > tried a simple setup (or try mark other files to permanent) to see whether > > you can get the expected behavior. Also, is there other custom code module > > in setup project that may touch the file? > > > > Sincerely, > > > > Steven Cheng > > > > Microsoft MSDN Online Support Lead > > > > > > This posting is provided "AS IS" with no warranties, and confers no rights. > > > > > > -------------------- Quote: > > >From: =?Utf-8?B?Zmx1dG9waGlsdXM=?= <flutophilus@xxxxxx> > > >Subject: VS2005 Setup Project File with Property 'Permanent' is uninstalled > > >Date: Wed, 5 Mar 2008 07:39:05 -0800 Quote: > > > > > >Hi, > > > > > >I'm working with VS2005 and I have a setup project that installs a Windows > > >forms application. I have a config file ( it's the app.config file - > > >MyApp.exe.config) which I want to leave on the target system if the > > >application is uninstalled. In the Setup Project File System designer I Quote: > > >the "permanent" property of this file to "True", which should leave the Quote: > > >installed if the user uninstalls the application. However if I uninstall Quote: > > >application using the setup.exe generated by the setup project it removes > > >this file. > > > > > >Am I doing something wrong? > > > > > > > > |
My System Specs![]() |
| | #7 (permalink) |
| | RE: VS2005 Setup Project File with Property 'Permanent' is uninsta It's a good idea, but I don't think that's it, because I did clear everything down, several times and try again. In other words I uninstalled, the file was removed, I re-installed using the "permanent" property and uninstalled and the file was still removed. I tried this several times and rechecked I had the permanent property set as it was not what I was expecting. I can only say that I did add and remove various outputs, files, .exe and dll's to the applications folder while trying to understand how setup projects work. It was only when I cleared down the setup project and started again that it worked. Now of course I can't reproduce the problem, but then I don't want to ![]() The trouble is I was trying to get the system to do what I thought it should do and I wasn't trying to record what I was doing in order to reproduce it, so I can't be absolutely clear. "Family Tree Mike" wrote: Quote: > Is it possible the file was installed with a setup where you had marked it as > not being permanent, but then ran your new installer to try and uninstall it? > If this is the case, the permanancy of the file had already been set. This > would explain why your later new build worked. > > "flutophilus" wrote: > Quote: > > Hi Steven, > > > > I created a test project as you suggested and it worked fine. I did wonder > > if the problem was becuase the file I was marking permanent was the config > > file (MyApp.exe.config) which is, I realised already included as part of the > > primary output from the main project. But it worked OK on this file, which is > > great. > > > > So I went back to my original project and removed and re-added the primary > > output and the config file separately, marked the coinfig file as permanent > > and to my great pleasure it worked !!! So I have no idea why it failed to > > wrok before. > > > > Now when I uninstal it leaves the config file behind. > > > > Interestingly if I re-instal into the same location it does not overwrite > > the config file. This is great but is it the expected behaviour ? Can I rely > > on it? > > > > Cheers > > > > > > > > ""Steven Cheng"" wrote: > > Quote: > > > Hi flutophilus, > > > > > > From your description, I understand you've built a setup project which set > > > a certain file to "permanent = true" so as to prevent it from being removed > > > at uninstall time, however, you found the file still got removed, correct? > > > > > > I agree that the "permanent=true" should keep the file from being removed > > > as you expected. I've also performed some simple tests by creating some > > > setup project and set some files(deploy to program files or desktop folder) > > > to "permanent =true", and they're preserved as expected after I uninstall > > > the program. Therefore, I think this should be a specific case. Have you > > > tried a simple setup (or try mark other files to permanent) to see whether > > > you can get the expected behavior. Also, is there other custom code module > > > in setup project that may touch the file? > > > > > > Sincerely, > > > > > > Steven Cheng > > > > > > Microsoft MSDN Online Support Lead > > > > > > > > > This posting is provided "AS IS" with no warranties, and confers no rights. > > > > > > > > > -------------------- > > > >From: =?Utf-8?B?Zmx1dG9waGlsdXM=?= <flutophilus@xxxxxx> > > > >Subject: VS2005 Setup Project File with Property 'Permanent' is uninstalled > > > >Date: Wed, 5 Mar 2008 07:39:05 -0800 > > > > > > > > > > >Hi, > > > > > > > >I'm working with VS2005 and I have a setup project that installs a Windows > > > >forms application. I have a config file ( it's the app.config file - > > > >MyApp.exe.config) which I want to leave on the target system if the > > > >application is uninstalled. In the Setup Project File System designer I > > > set > > > >the "permanent" property of this file to "True", which should leave the > > > file > > > >installed if the user uninstalls the application. However if I uninstall > > > the > > > >application using the setup.exe generated by the setup project it removes > > > >this file. > > > > > > > >Am I doing something wrong? > > > > > > > > > > > > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Uninstalled applications left permanent blank spaces in start menu | Vista General | |||
| VS2005 project components toolbox | .NET General | |||
| VS2005 Setup Project - How to prevent overwrite of file? | .NET General | |||
| VS2005 Opening project outside of IDE | Vista General | |||