Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,862

    UnisntallData.RemoveItem() question

    I have this code in a "post install" screen

    Code:
    UninstallData.RemoveItem(UNINDATA_SESSIONVARS, "%RawReg2%");
    As we don't want to expose the value of "RawReg2" to the user.

    However, this variable still shows up in the uninstall.xml file.

    How do we go about removing it using this call? I have a LOT of invested time into using this call -- so I'd rather not have to resort to using the xml plugin to remove these entries....

    Thanks
    -josh


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  2. #2
    Join Date
    May 2000
    Location
    Indigo Rose Software
    Posts
    2,150
    Josh,

    I am not totally clear on what the question is. At first glance I would say that you need to expand the session variable but that may not be what you are asking. Please explain further

    Adam Kapilik

  3. #3
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,862
    T
    Quote Originally Posted by Adam View Post
    I am not totally clear on what the question is. At first glance I would say that you need to expand the session variable but that may not be what you are asking. Please explain further
    Thanks Adam.

    When I run thru my installer, the uninstall.xml file contains a session variable "%rawreg2%".

    I want this variable removed from the uninstall.xml file -- the reverse of
    UninstallData.AddItem()

    I didn't ADD it to additem, but assume it's there becuase of the sessionvariable declaration.

    So; the question is --

    1) How can I remove the specific session variable from uninstall.xml?
    B) does UninstallData.RemoveItem() work?


    Cheers
    -j


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  4. #4
    Join Date
    May 2000
    Location
    Indigo Rose Software
    Posts
    2,150
    I couldn't get this working either. I have logged for a dev to look into. REF:14937

    Adam Kapilik

  5. #5
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,862
    Quote Originally Posted by Adam View Post
    I couldn't get this working either. I have logged for a dev to look into. REF:14937
    Rats.

    I don't suppose you have some xml.stuff() code that could remove items based on <name></name>?

    -j


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  6. #6
    Join Date
    Aug 2005
    Posts
    51
    An xml file is just a text file. You could use something like TextFile.ReadToString and String.Replace on the item in question. No idea what this would do to your uninstall.

  7. #7
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,862
    This is the code I came up with.

    Code:
    function uRemoveSessionVar( cName )
      local nElements = XML.Count( "SUF70UninstallData/SessionVars", "Var") ;
      for x = 1,nElements do
        if XML.GetValue("SUF70UninstallData/SessionVars/Var:"..x.."/Name") == cName then
          XML.RemoveElement("SUF70UninstallData/SessionVars/Var:"..x);
          x=nElements;  -- force end of loop
        end
      end
    end
    Since I'm removing a lot of variables that just aren't needed in the uninstall;
    I do this in my "post install" routine:

    Code:
    if File.DoesExist( UninstallData.GetConfigurationFile() ) then
        Application.SetLastError(0);
        XML.Load( UninstallData.GetConfigurationFile() );
        if Application.GetLastError() ~= 0 then
          -- Error loading XML
        else
          -- Pull elements out.
          uRemoveSessionVar( "%RawReg2%" );
    
          XML.Save( UninstallData.GetConfigurationFile() ) ;
        end
      else
        -- File isn't there.
      end
    Of course, i could make this a lot more useful by including the various values
    UNINDATA_SHORTCUTS, UNINDATA_SESSINVAR etc and adjusting the code; but all I care about (for now) is the session var....


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

Similar Threads

  1. Math.RandomSeed() question
    By stickck in forum AutoPlay Media Studio 6.0
    Replies: 8
    Last Post: 06-09-2006, 09:42 AM
  2. Kiosk Mode Window Manipulation Question
    By travisperkins in forum AutoPlay Media Studio 6.0
    Replies: 13
    Last Post: 03-06-2006, 07:40 AM
  3. question about sound mp3
    By Rapido78840 in forum AutoPlay Media Studio 4.0
    Replies: 4
    Last Post: 10-10-2003, 11:19 AM
  4. Need Assistance with Random Question Quiz
    By marc3515 in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 02-16-2003, 06:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts